Category: ABAP Programs

  • Create a SAP ABAP Project using ChatGPT

    What are SAP ABAP Projects, and why do we need them? SAP ABAP (Advanced Business Application Programming) is a programming language used to develop applications for the SAP software platform. SAP ABAP projects are collections of development objects and programs that are created, tested, and deployed as a unit. There are several reasons why SAP…

  • How to Integrate ChatGPT in SAP ABAP

    Introduction A general idea of how to integrate ChatGPT with SAP ABAP: First, you would need to have access to an instance of the ChatGPT model, either through the OpenAI API or by running the model locally. Next, you would need to create an ABAP program that calls the ChatGPT API and passes it input…

  • OOPS ALV in SAP ABAP

    Preface – This post is part of the ABAP Programs and Object Oriented ABAP series. Introduction The OO ALV is ALV using object-oriented ABAP. ALV stands for ABAP List Viewer and provides the standard list format and user interface for all the ABAP programs. The advantage of using OOPS ALV in SAP ABAP is that…

  • Function Imports in SAP OData

    Preface – This post is part of the ABAP Programs series. DATA: ls_parameter TYPE /iwbep/s_mgw_name_value_pair, lv_custid TYPE kunnr, lv_flag TYPE char1, lt_custinfo TYPE TABLE OF ztest_gw_srv, ls_custinfo TYPE ztest_gw_srv, ls_entity TYPE zcl_ztest_gw_srv_mpc=>ts_msg_return. IF iv_action_name = ‘demoFuncImport’. ” Check what action is being requested IF it_parameter IS NOT INITIAL. * Read Function import parameter value READ TABLE…

  • Convert JSON to ABAP Internal Table

    Preface – This post is part of the ABAP Programs series. TYPES: BEGIN OF t_entry, access_token TYPE string, token_type TYPE string, expires_in TYPE n LENGTH 8, scope TYPE string, jti TYPE string, END OF t_entry . TYPES: t_entry_map TYPE SORTED TABLE OF t_entry WITH UNIQUE KEY access_token. DATA: m_entries TYPE t_entry. DATA: lr_instance TYPE REF TO…

  • Create Object History in SAP Blockchain

    Preface – This post is part of the Blockchain on SAP Cloud Platform and ABAP Programs series. In this article, we will learn how to create a block in Blockchain on the SAP Cloud Platform. METHOD create_object_history. DATA: lo_http_client TYPE REF TO if_http_client. DATA: response TYPE string, lv_url TYPE string, lv_auth TYPE string. CONSTANTS :…

  • Get Proof history from the Blockchain Service using SAP ABAP

    Preface – This post is part of the Blockchain on SAP Cloud Platform and ABAP Programs series. In this step, we will call the blockchain service again using the token that we have stored in above step. And then we will receive the history of transactions from blockchain. METHOD get_proof_history. DATA: lo_http_client TYPE REF TO if_http_client.…

  • Get Token from SAP Cloud Platform Service

    Preface – This post is part of the ABAP Programs series. In this step we will call the service to get the token and store that token in a global variable for later use. METHOD get_token. DATA: lo_http_client TYPE REF TO if_http_client. DATA: response TYPE string, lv_url TYPE string. CONSTANTS: lv_initial_url TYPE string VALUE ‘<Blockchain Service…

  • Calculate a hash in ABAP

    Preface – This post is part of the ABAP Programs series. In ABAP we can perform the following: calculate_hash_for_raw METHOD calculate_hash_for_raw. TRY. cl_abap_message_digest=>calculate_hash_for_raw( EXPORTING if_algorithm = ‘SHA256’ if_data = iv_data IMPORTING ef_hashstring = ev_sha256 ). CATCH cx_root. ” Eh, what’re you gonna do? ENDTRY. ENDMETHOD. calculate_hash_for_string METHOD calculate_hash_for_string. TRY. cl_abap_message_digest=>calculate_hash_for_char( EXPORTING if_algorithm = ‘SHA256’ if_data =…

  • Type Casting in ABAP Class

    Preface – This post is part of the ABAP Programs series. Type Casting in ABAP Class Note: If you are searching for basic type casting/conversion of ABAP variable in Reports/Program, click here. Prerequisite: 1. You must have a basic Idea of local class and instance/reference of class. 2. Inheritance and Polymorphism concept Note: Parent Class is…