FUNCTION zfm_json_2abap.
*"----------------------------------------------------------------------
"“本地接口:
*” IMPORTING
*" VALUE(I_INPUT) TYPE STRING
*" EXPORTING
*" REFERENCE(E_RETDATA)
*"----------------------------------------------------------------------
-
DATA: lt_flight TYPE STANDARD TABLE OF sflight,
-
lrf_descr TYPE REF TO cl_abap_typedescr.
data: lv_json TYPE zcl_json=>json.
DATA: lo_json TYPE REF TO zcl_json.TYPES: BEGIN OF ts_record,
id TYPE string,
columns TYPE REF TO zcl_json,
END OF ts_record.DATA:
lt_data TYPE SORTED TABLE OF ts_record WITH UNIQUE KEY id,
ls_data LIKE LINE OF lt_data.lv_json = i_input.
CREATE OBJECT lo_json.
lo_json->deserialize( EXPORTING json = lv_json
pretty_name = abap_true
CHANGING data = e_retdata
).ENDFUNCTION.