<?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: REST Receiver - JSON Format - Unnamed array inside array - Remove FieldNames in structure in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/rest-receiver-json-format-unnamed-array-inside-array-remove-fieldnames-in/qaa-p/627122#M154676</link>
    <description>&lt;P&gt;Thanks, i will try with this solution and let you know... i have to apply SP007 to our PI system to test it. &lt;/P&gt;</description>
    <pubDate>Mon, 04 Jun 2018 20:51:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2018-06-04T20:51:28Z</dc:date>
    <item>
      <title>REST Receiver - JSON Format - Unnamed array inside array - Remove FieldNames in structure</title>
      <link>https://community.sap.com/t5/technology-q-a/rest-receiver-json-format-unnamed-array-inside-array-remove-fieldnames-in/qaq-p/627117</link>
      <description>&lt;P&gt;Hi all, &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Is there any way i can build an XML structure on SAP PI 7.5 and then convert it to JSON (using REST adapter) to generate this:&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;{  
   "Headers":[  
      "ID",
      "City",
      "Country"
   ],
   "Lines":[  
      [  
         12345,
         "NEWYORK",
         "USA"
      ],
      [  
         12346,
          "TORONTO",
         "CANADA"
      ],
      [  
         12347,
         "WASHINGTON",
         "USA"
      ]
   ]
}
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;this is the template of previous structure:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;{  
   "Headers":[  
      "FieldName1",
      "FieldName2",
      "FieldName3"
   ],
   "Lines":[  
      [  
         FieldName1-Value1,
         FieldName2-"Value1",
         FieldName3-"Value1",
      ],
      [  
         FieldName1-Value2,
         FieldName2-"Value2",
         FieldName3-"Value2",
      ],
      [  
         FieldName1-Value3,
         FieldName2-"Value3",
         FieldName3-"Value3",
      ]
   ]
}

&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;The problem is with the "Lines" structure. There is an array inside the array "Lines" but it has no name on it. &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; I was thinking to use JAVA mapping to generate it, but i prefer to use a standard way.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 23:25:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rest-receiver-json-format-unnamed-array-inside-array-remove-fieldnames-in/qaq-p/627117</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-05-31T23:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: REST Receiver - JSON Format - Unnamed array inside array - Remove FieldNames in structure</title>
      <link>https://community.sap.com/t5/technology-q-a/rest-receiver-json-format-unnamed-array-inside-array-remove-fieldnames-in/qaa-p/627118#M154672</link>
      <description>&lt;P&gt;Hi Israel!&lt;/P&gt;
  &lt;P&gt;Looking at your template the first question is: how should respective XML structure for your JSON input look like, since you describe unnamed array inside your JSON?&lt;/P&gt;
  &lt;P&gt;Regards, Evgeniy.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 11:21:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rest-receiver-json-format-unnamed-array-inside-array-remove-fieldnames-in/qaa-p/627118#M154672</guid>
      <dc:creator>former_member190293</dc:creator>
      <dc:date>2018-06-01T11:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: REST Receiver - JSON Format - Unnamed array inside array - Remove FieldNames in structure</title>
      <link>https://community.sap.com/t5/technology-q-a/rest-receiver-json-format-unnamed-array-inside-array-remove-fieldnames-in/qaa-p/627119#M154673</link>
      <description>&lt;P&gt;Hi Evgeniy, &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;That is the issue we have... the unnamed array. &lt;/P&gt;
  &lt;P&gt;This is the way we think to build the XML target structure. &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/155609-capture.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;When we send this to REST adapter, the Headers looks good but not the Lines.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;{  
   "Headers":[  
      "ID",
      "City",
      "Country"
   ],
   "Lines":[  
      "12345,\"NEWYORK\",\"USA\"",
      "12346,\"TORONTO\",\"CANADA\"",
      "12347,\"WASHINGTON\",\"USA\""
   ]
}
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Do you know how can we have the unnamed array inside lines?&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Just as reference, this is the source Structure... &lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/155608-source.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 13:57:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rest-receiver-json-format-unnamed-array-inside-array-remove-fieldnames-in/qaa-p/627119#M154673</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-06-01T13:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: REST Receiver - JSON Format - Unnamed array inside array - Remove FieldNames in structure</title>
      <link>https://community.sap.com/t5/technology-q-a/rest-receiver-json-format-unnamed-array-inside-array-remove-fieldnames-in/qaa-p/627120#M154674</link>
      <description>&lt;P&gt;I already build a structure:&lt;/P&gt;
  &lt;P&gt;I paste the below XML to this Page: &lt;A href="https://www.freeformatter.com/xml-to-json-converter.html#ad-output"&gt;https://www.freeformatter.com/xml-to-json-converter.html#ad-output&lt;/A&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;&amp;lt;ns0:MT_API xmlns:ns0="http://test.com/API"&amp;gt;&amp;lt;Headers&amp;gt;&amp;lt;List&amp;gt;ID&amp;lt;/List&amp;gt;&amp;lt;List&amp;gt;City&amp;lt;/List&amp;gt;&amp;lt;List&amp;gt;Country&amp;lt;/List&amp;gt;&amp;lt;/Headers&amp;gt;&amp;lt;Lines&amp;gt;&amp;lt;List&amp;gt;&amp;lt;List&amp;gt;12345&amp;lt;/List&amp;gt;&amp;lt;List&amp;gt;NEWYORK&amp;lt;/List&amp;gt;&amp;lt;List&amp;gt;USA&amp;lt;/List&amp;gt;&amp;lt;/List&amp;gt;&amp;lt;List&amp;gt;&amp;lt;List&amp;gt;12346&amp;lt;/List&amp;gt;&amp;lt;List&amp;gt;TORONTO&amp;lt;/List&amp;gt;&amp;lt;List&amp;gt;CANADA&amp;lt;/List&amp;gt;&amp;lt;/List&amp;gt;&amp;lt;List&amp;gt;&amp;lt;List&amp;gt;12347&amp;lt;/List&amp;gt;&amp;lt;List&amp;gt;WASHINGTON&amp;lt;/List&amp;gt;&amp;lt;List&amp;gt;USA&amp;lt;/List&amp;gt;&amp;lt;/List&amp;gt;&amp;lt;/Lines&amp;gt;&amp;lt;/ns0:MT_API&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;and it converts the XML to the JSON i expected:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;{
  "Headers": [
    "ID",
    "City",
    "Country"
  ],
  "Lines": [
    [
      "12345",
      "NEWYORK",
      "USA"
    ],
    [
      "12346",
      "TORONTO",
      "CANADA"
    ],
    [
      "12347",
      "WASHINGTON",
      "USA"
    ]
  ]
}
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;but when i run it on SAP PI, it returns:&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;{  
   "Headers":[  
      {  
         "List":[  
            "ExternalID",
            "City",
            "Country"
         ]
      }
   ],
   "Lines":[  
      {  
         "List":[  
            {  
               "List":[  
                  12345,
                  "MONTERREY",
                  "MEXICO"
               ]
            },
            {  
               "List":[  
                  12346,
                  "GUADALAJARA",
                  "MEXICO"
               ]
            },
            {  
               "List":[  
                  12347,
                  "CDMX",
                  "MEXICO"
               ]
            }
         ]
      }
   ]
}
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;how can I remove the "List" tag?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 22:12:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rest-receiver-json-format-unnamed-array-inside-array-remove-fieldnames-in/qaa-p/627120#M154674</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-06-01T22:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: REST Receiver - JSON Format - Unnamed array inside array - Remove FieldNames in structure</title>
      <link>https://community.sap.com/t5/technology-q-a/rest-receiver-json-format-unnamed-array-inside-array-remove-fieldnames-in/qaa-p/627121#M154675</link>
      <description>&lt;P&gt;Too remove list tag add a parameter for adapter module as : setIgnoredElements with value List&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jun 2018 07:53:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rest-receiver-json-format-unnamed-array-inside-array-remove-fieldnames-in/qaa-p/627121#M154675</guid>
      <dc:creator>manoj_khavatkopp</dc:creator>
      <dc:date>2018-06-03T07:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: REST Receiver - JSON Format - Unnamed array inside array - Remove FieldNames in structure</title>
      <link>https://community.sap.com/t5/technology-q-a/rest-receiver-json-format-unnamed-array-inside-array-remove-fieldnames-in/qaa-p/627122#M154676</link>
      <description>&lt;P&gt;Thanks, i will try with this solution and let you know... i have to apply SP007 to our PI system to test it. &lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 20:51:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rest-receiver-json-format-unnamed-array-inside-array-remove-fieldnames-in/qaa-p/627122#M154676</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-06-04T20:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: REST Receiver - JSON Format - Unnamed array inside array - Remove FieldNames in structure</title>
      <link>https://community.sap.com/t5/technology-q-a/rest-receiver-json-format-unnamed-array-inside-array-remove-fieldnames-in/qaa-p/627123#M154677</link>
      <description>&lt;P&gt;I did it using java mapping to convert XML into JSON (on mapping) and remove the check to convert from XML to JSON in communication channel receiver. &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;The solution proposed by &lt;A href="https://answers.sap.com/users/2781/manojkhavatkopp.html"&gt;Manoj K&lt;/A&gt; works, but our PI environment is not updated to SP007. &lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 19:57:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/rest-receiver-json-format-unnamed-array-inside-array-remove-fieldnames-in/qaa-p/627123#M154677</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-06-08T19:57:48Z</dc:date>
    </item>
  </channel>
</rss>

