DATA: lt_flight TYPE STANDARD TABLE OF sflight, lrf_descr TYPE REF TO cl_abap_typedescr, lv_json TYPE string. SELECT * FROM sflight INTO TABLE lt_flight. * serialize table lt_flight into JSON, skipping initial fields and * converting ABAP field names into camelCase lv_json = /ui2/cl_json=>serialize( data = lt_flight compress = abap_true pretty_name = /ui2/cl_json=>pretty_mode-camel_case ). WRITE / lv_json. * LV_JSON will have the coverted records to JSON CLEAR lt_flight. * deserialize JSON string json into internal table * lt_flight doing camelCase to ABAP like field name mapping /ui2/cl_json=>deserialize( EXPORTING json = lv_json pretty_name = /ui2/cl_json=>pretty_mode-camel_case CHANGING data = lt_flight ). * LT_FLIGHT[] will have the coverted records from JSON
Monday, 6 May 2019
JSON to Internal Tables & vice-versa
Subscribe to:
Posts (Atom)
Report to find CDS view of Standard Table
A small change has been made to the original program ( SAP YARD Article ) so that it can also display the common CDS used by multiple table...
-
Step 1: Goto Transaction: SE41 Step 2: Click on Status or press CTRL+F6 Step 3: Fill up the dialog box as below: Frm Program: SAPLSALV...
-
Report: Z_R_ALV REPORT z_r_alv . CLASS gcl_event_handler DEFINITION DEFERRED . "Data Declaration INCLUDE z_r_alv_top . "...
-
AT SELECTION-SCREEN OUTPUT event gets triggered before generating the Selection Screen. Thus, it can be used to manipulate the elements of...