cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CPI XML to JSON conversion: Force output as an Array

filipe_rieger
Explorer
10,611

Hi,

I am passing following XML to the XML to Json converter:

<ns1:AddressCurationResponse xmlns:ns1="urn:sap-com:document:sap:rfc:functions">
	<CurationInformation>
		<item>
			<Changes>
				<item>
					<ACTION>xyz</ACTION>
					<FIELD>xyz</FIELD>
					<MESSAGE>xyz</MESSAGE>
				</item>
				<item>
					<ACTION>xyz</ACTION>
					<FIELD>xyz</FIELD>
					<MESSAGE>xyz</MESSAGE>
				</item>
			</Changes>
			<PostalAddress>
				<CityName>xyz</CityName>
				<DistrictName>xyz</DistrictName>
			</PostalAddress>
			<Rating>
				<SCORE>1</SCORE>
				<ACCURACYINDICATOR>1</ACCURACYINDICATOR>
				<CURATIONLEVEL>1</CURATIONLEVEL>
			</Rating>
		</item>
	</CurationInformation>
</ns1:AddressCurationResponse>


Now I want the converter to force output the element ns1:AddressCurationResponse/CurationInformation/item as a json array with [] instead of {}.In the converter there is the option to use json streaming:

But upon saving, its telling me that the table should not be empty:

What am I missing?

The same question was also asked here, but the solution was not shown unfortunately:

https://answers.sap.com/questions/12689222/get-xml-element-in-json-array-using-xml-o-json-con.html

View Entire Topic
filipe_rieger
Explorer
0 Kudos

Hi Both,

you are right. This is just a display bug.

Thanks a lot for your prompt feedback!!