Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a type in SAP to serialize and deserialize the json with string and number format

RachamallaKiran
Participant
0 Kudos
173

hi all,

I have the following JSON format and would like to know how to serialize and deserialize it in ABAP.

{sample: true

ABC: [ [ 2, " ABC " ], [3, "CDS],[4,"TAB"]..]

}

Here my doubt is

What kind of ABC should there be here, I wonder?

I can create a table of tables, however the values in the table are only strings and integers without any further components.

1 REPLY 1

Sandra_Rossi
Active Contributor
0 Kudos
120

It's up to you to choose the adequate type. A STRING type can contain both "2", "3", "4", "ABC", "CDS", etc.

You may also decide to have a table with structured lines made of 2 components, one being the number, one being the string.