Hi all,
I have the following JSON response being returned from a third-party API.
I would like programmatically move it ABAP data structure to make use of it.
Couple of things:
1. It contains arrays without a name (valid JSON)
2. You would also see in lines like below, the key (or object name) is not available in all cases, just the value as part of the array.
"VALUES":[
105333744
]I understand that I need to define a deep structure to use CALL TRANSFORMATION id.
id Transformation would work if all values have their own name (please correct me if I am wrong) and a corresponding place to move into in the ABAP data structure.
Questions:
I have read many forum discussions and understand the basics of transforming plain JSON structure contain key-value pairs or arrays containing flat table structure to ABAP structure or internal tables.
My problem is similar to this unanswered forum question.
Thanks.
JSON response:
[
{
"AVAILABILITY":{
"APPLICATIONCLOSES":{
"CLOSEDATE":"2017-12-31T10:55:00.000Z"
},
"AVAILABLEEXT":true,
"AVAILABLEINT":true,
"JOBPUBLISHED":{
"PUBLISHDAT":"2017-03-27T05:11:41.000Z"
}
},
"CATEGORIES":[
{
"CATEGORY":104769015,
"VALUES":[
105333744
]
},
{
"CATEGORY":100039352,
"VALUES":[
100109072
]
},
{
"CATEGORY":100037613,
"VALUES":[
100042903
]
},
{
"CATEGORY":100001999,
"VALUES":[
100039226
]
},
{
"CATEGORY":100015632,
"VALUES":[
100015639
]
},
{
"CATEGORY":100117002,
"VALUES":[
100117006
]
},
{
"CATEGORY":100015595,
"VALUES":[
100015610
]
},
{
"CATEGORY":100116504,
"VALUES":[
100116555
]
}
],
"CODE":"19399",
"ID":105511844,
"ITEMS":[
],
"SHORTSUM":"<p>short description for app developer position</p><p>second line of description</p>",
"TITLE":"App Developer"
}
]
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Resolved by writing a custom parser.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any help would be highly appreciated.
I am currently investigating using CL_TREX_JSON_SERIALIZER and ABAP RTTI conepts.
Ideally, I would prefer not to modify the JSON response (and introduce object names to unnamed objects).
Unnamed objects:
"VALUES":[105333744,
105399999,
]Objects with name:
"VALUES":["value":105333744,
"value":105399999,
]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.