<?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>topic Re: Convert json to abap structure in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-json-to-abap-structure/m-p/12632092#M2013446</link>
    <description>&lt;P&gt;It's not valid JSON format. For instance, it would be valid if you wrap it between { and }.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jun 2022 07:36:43 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2022-06-28T07:36:43Z</dc:date>
    <item>
      <title>Convert json to abap structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-json-to-abap-structure/m-p/12632091#M2013445</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;
  &lt;P&gt;I'm trying to convert a JSON File into ABAP Deep entity table&lt;/P&gt;
  &lt;P&gt;JSON File Format&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;{  "Orders": {
    "Order": [
      {
        "Customer": "Test1",
        "SaleType": "",
        "Item Nav": [
          {
            "ItmNumber": "1",
            "Material": "11",            
          },
          {
            "ItmNumber": "2",
            "Material": "22",
          }
        ]
       
      },
      {
        "Customer": "Test2",
        "SaleType": "",
       
        "Item Nav": [
          {
            "ItmNumber": "1",
            "Material": ""
          },
          {
            "ItmNumber": "2",
            "Material": ""
          }
        ]
        
      }

    ]

  }
}&lt;/CODE&gt;&lt;/PRE&gt; 
  &lt;PRE&gt;&lt;CODE&gt;TYPES : BEGIN OF ts_sales_item_data,&amp;lt;br&amp;gt;          ItmNumber TYPE char5,&amp;lt;br&amp;gt;          Material  TYPE char5,&amp;lt;br&amp;gt;        END OF ts_sales_item_data.
TYPES: BEGIN OF ty_deep_entity,
customer TYPE char10,
 saletype TYPE vkorg,
 headertoitem TYPE TABLE OF ts_sales_item_data WITH DEFAULT KEY,
 END OF ty_deep_entity.


DATA: it_result TYPE TABLE OF ty_deep_entity,
  &amp;lt;br&amp;gt; wa_result TYPE ty_deep_entity.
  &amp;lt;br&amp;gt;CALL METHOD cl_fdt_json=&amp;gt;json_to_data
  &amp;lt;br&amp;gt; EXPORTING
  &amp;lt;br&amp;gt; iv_json = result
  &amp;lt;br&amp;gt; CHANGING
  &amp;lt;br&amp;gt; ca_data = wa_result.
  &lt;/CODE&gt;&lt;/PRE&gt; For some reason - I don't see any records into wa_result. 
  &lt;BR /&gt;Any suggestions would be appreciated 
  &lt;BR /&gt;Thanks in advance</description>
      <pubDate>Tue, 28 Jun 2022 07:25:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-json-to-abap-structure/m-p/12632091#M2013445</guid>
      <dc:creator>venk123</dc:creator>
      <dc:date>2022-06-28T07:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Convert json to abap structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-json-to-abap-structure/m-p/12632092#M2013446</link>
      <description>&lt;P&gt;It's not valid JSON format. For instance, it would be valid if you wrap it between { and }.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 07:36:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-json-to-abap-structure/m-p/12632092#M2013446</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-28T07:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convert json to abap structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-json-to-abap-structure/m-p/12632093#M2013447</link>
      <description>&lt;P&gt;Sandra - Does that look right now ..Even than i'm having issues..Is there an issue in ABAP Code&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 12:46:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-json-to-abap-structure/m-p/12632093#M2013447</guid>
      <dc:creator>venk123</dc:creator>
      <dc:date>2022-06-28T12:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert json to abap structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-json-to-abap-structure/m-p/12632094#M2013448</link>
      <description>&lt;P&gt;The type of the argument of parameter CA_DATA doesn't reflect the JSON structure. There is "Order" which is an array of customers, but the type of your argument contains only one customer. I don't see how JSON_TO_DATA can find the relationship between the JSON structure and the type of the argument.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 13:10:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-json-to-abap-structure/m-p/12632094#M2013448</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-28T13:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Convert json to abap structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-json-to-abap-structure/m-p/12632095#M2013449</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;please chck the Method&lt;/P&gt;&lt;P&gt;/ui2/cl_json=&amp;gt;deserialize(&lt;/P&gt;&lt;P&gt;You can also check the reverse way to serialized your table structure to JSON&lt;/P&gt;&lt;P&gt;to check the correct syntax.&lt;/P&gt;&lt;P&gt;The JSON type SalesType will be transferred to the abap field sales_type &lt;/P&gt;&lt;P&gt;with the camel case mode:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  lv_json = /ui2/cl_json=&amp;gt;serialize( &lt;BR /&gt;                  data        = it_result &lt;BR /&gt;                  pretty_name   = /ui2/cl_json=&amp;gt;pretty_mode-camel_case
&lt;BR /&gt;                                                        compress    = abap_true
                                      ).&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Jun 2022 16:14:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-json-to-abap-structure/m-p/12632095#M2013449</guid>
      <dc:creator>ThorstenHoefer</dc:creator>
      <dc:date>2022-06-28T16:14:31Z</dc:date>
    </item>
  </channel>
</rss>

