What is SAP Cloud Application Programming Model

3 Introduction We have been writing codes in different languages (such as ABAP, CDS, UI5/FIori and OData) at different platform (SAP NetWeaver, SAP Editor, HANA Studio, and SAP Web IDE) to achieve CRUD operation on business data. These all have their own limitation such as source independent development, platform independent development, etc. To remove dependency […]

Function Imports in SAP OData

3 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 it_parameter INTO ls_parameter WITH KEY name = ‘CustId’. IF […]

Convert JSON to ABAP Internal Table

2 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 /ui5/cl_json_parser. CREATE OBJECT lr_instance. CALL METHOD me->get_token. IF gv_token […]

Create Object History in SAP Blockchain

3 In this article we will learn how to create a block in Blockchain at 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 : lv_initial_url TYPE string VALUE ‘<Your_Service>’. IF iv_object_id IS NOT INITIAL. *** Getting Token TYPES: BEGIN OF t_entry, […]

Get Token from SAP Cloud Platform Service

3 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 Link>’, lv_auth TYPE string VALUE ‘Basic <your login credentials>’. […]

Calculate a hash in ABAP

3 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 = iv_data IMPORTING ef_hashstring = ev_sha256 ). CATCH cx_root. ” […]

Data Binding in Web Dynpro

3 Introduction A Web Dynpro Application is developed using MVC (Model View Controller) Architecture. It means whatever data model is there that requires binding with the View elements (e.g. Input Field, Check box, Table, etc.). This binding can be achieved using view and controller. In this article we will explore data binding in Web Dynpro. […]

Blockchain Implementation in ABAP

5 Introduction With the introduction of Blockchain in SAP Cloud Platform, the important questions for SAP developers was its implementation in SAP ABAP. All the client information of SAP is mainly on premise based. The major amount of data is already stored in backend system and if we cannot push this data on blockchain then […]

Translate »