Skip to Content
0
Jan 18, 2023 at 01:46 PM

json field name mapping

382 Views

hello experts,

I currently have a json output where I should map abap deep structure field names to the expected json output.

ex: /XYZ/V_CRNCY -> VCRNCY. I'm currently using a REPLACE ALL REGEX to remove the /XYZ/ from each field but I think there should be a way to do this using the /ui2/cl_json class attributes.

In addition, I should return the values of each deep structure in a results array, remove client field from output and format dates so that there are no dashes where the data type is DATS

ex: "STRUCT_NAV": [

{

"MANDT": "200",

}

]

"STRUCT_NAV": {

"results": []

}

I've attached my structure and current json where I am attempting to use /ui2/cl_json class to serialize and output the json. I apologize if I haven't provided enough information and will be glad to provide more to receive some help.

sample.txt

Attachments

sample.txt (1.5 kB)