2016 Jul 01 12:15 AM
Hi,
I have tried using the method - cl_fdt_json=>json_to_data to transform JSON to ABAP.
It worked for simple fields but for Arrays it failed.
Need your expert opinion on this.
Regards,
Faiz
2016 Jul 11 9:15 PM
Hi,
I was able to transform the data using
cl_fdt_json=>json_to_data( EXPORTING iv_json = abap_string
CHANGING ca_data = out_structure ).
Regards,
Faiz
Hi,
I have tried using the method - cl_fdt_json=>json_to_data to transform JSON to ABAP.
It worked for simple fields but for Arrays it failed.
Need your expert opinion on this.
Regards,
Faiz
2016 Jul 01 1:22 AM
try as below
DATA: lv_json type string, "your json string
lv_data type zstructure. "your structure
DATA(lr_reader) = cl_sxml_string_reader=>create( cl_abap_codepage=>convert_to( lv_json ) ).
CALL TRANSFORMATION id
SOURCE XML lr_reader
RESULT data = lv_data.
2016 Jul 01 7:18 AM
Mohammad is right, in that you should use the official way for handling JSON, i.e. use sXML classes (as per the ABAP documentation, read it please).
What we don't know, is the exact type of your internal table containing the JSON, and if it's of byte type in which code page the JSON is stored...
2016 Jul 11 9:15 PM
Hi,
I was able to transform the data using
cl_fdt_json=>json_to_data( EXPORTING iv_json = abap_string
CHANGING ca_data = out_structure ).
Regards,
Faiz
2019 May 08 10:35 AM
Hi Faizur,
Greeting of the day,
Thank you very much.... It is 100% working.
Regrads,
Srinivasa Reddy.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |