cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP (Deep Structure with Table Type) to JSON Conversion

05-05-2021 3:58 PM
saravanan_palani Discoverer
4690 views 4 comments
SAP Managed Tags
Subscribe

Hi,

I'm in the process of dynamically getting JSON string from nested structure or table type, example "VMDS_EI_MAIN". And i'm using below class to serialize

ls_json-value = /ui2/cl_json=>serialize( data = gs_vmds_extern compress = abap_false
pretty_name = /ui2/cl_json=>pretty_mode-camel_case ).

It gives me just field name 'vendor' as table type

where as i'm expecting a JSON output with fields of all nested structures and table types of 'VMDS_EI_MAIN" inside {"vendors": [] }

Really grateful on any help in this.

Brief about my requirement.

Creating a OData service which will call class and methods dynamically. I need to pass method parameter(s) value as JSON, so first I need to get JSON format of given method parameter so that user can give input values in required fields. Now the JSON string will be send with input values that should be deserialized and passed to respective method parameter.

Thanks in advance

Saran

Accepted Solutions (0)

Answers (0)