<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: JSON to ABAP in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/json-to-abap/qaa-p/434919#M60253</link>
    <description>&lt;P&gt;Any help would be highly appreciated.&lt;/P&gt;&lt;P&gt;I am currently investigating using CL_TREX_JSON_SERIALIZER and ABAP RTTI conepts.&lt;/P&gt;&lt;P&gt;Ideally, I would prefer not to modify the JSON response (and introduce object names to unnamed objects).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Unnamed objects:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"VALUES":[105333744,
105399999,
]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Objects with name:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"VALUES":["value":105333744,
"value":105399999,&lt;BR /&gt;]&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 05 Apr 2017 04:49:03 GMT</pubDate>
    <dc:creator>aabhas_wilmar</dc:creator>
    <dc:date>2017-04-05T04:49:03Z</dc:date>
    <item>
      <title>JSON to ABAP</title>
      <link>https://community.sap.com/t5/technology-q-a/json-to-abap/qaq-p/434918</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have the following JSON response being returned from a third-party API.&lt;/P&gt;&lt;P&gt;I would like programmatically move it ABAP data structure to make use of it.&lt;/P&gt;&lt;P&gt;Couple of things:&lt;/P&gt;&lt;P&gt;1. It contains arrays without a name (valid JSON)&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"VALUES":[
               105333744
            ]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I understand that I need to define a deep structure to use CALL TRANSFORMATION id. &lt;/P&gt;&lt;P&gt;id Transformation would work &lt;STRONG&gt;if all values have their own name&lt;/STRONG&gt; (please correct me if I am wrong) and a corresponding place to move into in the ABAP data structure.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;B&gt;What do we do when there are unnamed objects / arrays in JSON data? &lt;/B&gt;&lt;/LI&gt;&lt;LI&gt;&lt;B&gt;Is there a better way to deserialize complex JSON structures containing values without object names, arrays etc?&lt;/B&gt;&lt;/LI&gt;&lt;LI&gt;&lt;B&gt;Is it possible to get this data returned into field-symbols or generic data so that developer doesn't need to worry about defining the structure (system determines the structure dynamically?&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;My problem is similar to &lt;A href="https://answers.sap.com/questions/50505/json-to-abap-using-a-generic-type.html"&gt;this&lt;/A&gt; unanswered forum question.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;JSON response:&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;[
   {
      "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":"&amp;lt;p&amp;gt;short description for app developer position&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;second line of description&amp;lt;/p&amp;gt;",
      "TITLE":"App Developer"
   }
]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Apr 2017 07:05:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/json-to-abap/qaq-p/434918</guid>
      <dc:creator>aabhas_wilmar</dc:creator>
      <dc:date>2017-04-04T07:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: JSON to ABAP</title>
      <link>https://community.sap.com/t5/technology-q-a/json-to-abap/qaa-p/434919#M60253</link>
      <description>&lt;P&gt;Any help would be highly appreciated.&lt;/P&gt;&lt;P&gt;I am currently investigating using CL_TREX_JSON_SERIALIZER and ABAP RTTI conepts.&lt;/P&gt;&lt;P&gt;Ideally, I would prefer not to modify the JSON response (and introduce object names to unnamed objects).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Unnamed objects:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"VALUES":[105333744,
105399999,
]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Objects with name:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"VALUES":["value":105333744,
"value":105399999,&lt;BR /&gt;]&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Apr 2017 04:49:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/json-to-abap/qaa-p/434919#M60253</guid>
      <dc:creator>aabhas_wilmar</dc:creator>
      <dc:date>2017-04-05T04:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: JSON to ABAP</title>
      <link>https://community.sap.com/t5/technology-q-a/json-to-abap/qaa-p/434920#M60254</link>
      <description>&lt;P&gt;Resolved by writing a custom parser.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 06:51:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/json-to-abap/qaa-p/434920#M60254</guid>
      <dc:creator>aabhas_wilmar</dc:creator>
      <dc:date>2017-08-09T06:51:29Z</dc:date>
    </item>
  </channel>
</rss>

