Skip to Content
Aug 01, 2019 at 01:51 PM

ABAP deserialize JSON to table


I need to populate tables in ABAP from data received through an API.

I'm using the following ABAP function to populate an existing ABAP table from json.

The JSON is correct, and the Table contains corresponding tables within tables.

<code>/ui2/cl_json=>deserialize( EXPORTING json = lv_json
                             CHANGING data = lt_abap  ).

Running this returns a blank lt_abap table.

When changing the output to be a structure this works fine. But the problem is a need a TABLE, rather than a STRUCTURE for subsequent calls

<code>/ui2/cl_json=>deserialize( EXPORTING json = lv_json
                             CHANGING data = ls_abap

Can anyone suggest a solution o get he JSON into my TABLE?