<?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: Serialize json to ABAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/serialize-json-to-abap/m-p/12196850#M1981348</link>
    <description>&lt;P&gt;Oh man thanks a lot !. From now i'm going to check the format always!&lt;/P&gt;</description>
    <pubDate>Sat, 14 Mar 2020 16:57:24 GMT</pubDate>
    <dc:creator>naotoxxx</dc:creator>
    <dc:date>2020-03-14T16:57:24Z</dc:date>
    <item>
      <title>Serialize json to ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serialize-json-to-abap/m-p/12196848#M1981346</link>
      <description>&lt;P&gt;Hello i'm triying to use /UI2/CL_JSON class =&amp;gt; SERIALIZE() i pass my json and create my structure but my structured is not filled.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_a,
        BUKRS(25),
        VSTEL(25),
        VKORG(25),
        FECHA(25),
        CANAL(25),
        SECTOR(25),
        SOLIC(25),
       END OF ty_a,
       BEGIN OF ty_b,
        pedido(25),
        werks(25),
        posiciones TYPE zborrar_posiciones,"TYPE TABLE of a structure with two fields: matnr and ctdad
        suppl_plnt(25),
        lotno(25),
        bokno(25),
        kschl(25),
        trans(25),
        printer(25),
        msg(25),
       END OF ty_b,
       BEGIN OF ty_x,
        accion(10),
        input TYPE ty_a,
        data_cont TYPE ty_b,
       END OF ty_x.


DATA: ls_info TYPE ty_x.
* deserialize JSON string json into internal table lt_flight doing camelCase to ABAP like field name mapping
DATA: str1 TYPE string VALUE '"accion":"CREA_LA","input":{"BUKRS":"","VSTEL":"","VKORG":"","FECHA":"","CANAL":"","SECTOR":"","SOLIC":""},"data_cont":{"pedido":"219135968","werks":"1100"'.
DATA: str2 TYPE string VALUE ',"suppl_plnt":"","lotno":"","bokno":"","kschl":"","trans":"","printer":"","msg":""}'.
DATA: final TYPE string.

CONCATENATE str1 str2 INTO final.
/ui2/cl_json=&amp;gt;deserialize( EXPORTING json = final pretty_name = /ui2/cl_json=&amp;gt;pretty_mode-camel_case CHANGING data = ls_info ).
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;The last line it's executed but is not filling my structure, what am i doing wrong ???&lt;/P&gt;</description>
      <pubDate>Sat, 14 Mar 2020 00:48:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serialize-json-to-abap/m-p/12196848#M1981346</guid>
      <dc:creator>naotoxxx</dc:creator>
      <dc:date>2020-03-14T00:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Serialize json to ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serialize-json-to-abap/m-p/12196849#M1981347</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;naotoxxx&lt;/SPAN&gt; As your JSON string is not a valid JSON the deserialization does nothing. Why your string is not a valid JSON string? Because the opening and closing curly brackets are missing. In the following formatted example of your string, the first and last line I added.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;{ 
	"accion": "CREA_LA",
	"input": {
		"BUKRS": "",
		"VSTEL": "",
		"VKORG": "",
		"FECHA": "",
		"CANAL": "",
		"SECTOR": "",
		"SOLIC": ""
	},
	"data_cont": {
		"pedido": "219135968",
		"werks": "1100",
		"suppl_plnt": "",
		"lotno": "",
		"bokno": "",
		"kschl": "",
		"trans": "",
		"printer": "",
		"msg": ""
	}
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 14 Mar 2020 07:03:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serialize-json-to-abap/m-p/12196849#M1981347</guid>
      <dc:creator>pfefferf</dc:creator>
      <dc:date>2020-03-14T07:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Serialize json to ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/serialize-json-to-abap/m-p/12196850#M1981348</link>
      <description>&lt;P&gt;Oh man thanks a lot !. From now i'm going to check the format always!&lt;/P&gt;</description>
      <pubDate>Sat, 14 Mar 2020 16:57:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/serialize-json-to-abap/m-p/12196850#M1981348</guid>
      <dc:creator>naotoxxx</dc:creator>
      <dc:date>2020-03-14T16:57:24Z</dc:date>
    </item>
  </channel>
</rss>

