Skip to Content
0

How to merge 2 payloads into single xml payload in SAP HCI

Dec 09, 2017 at 02:50 PM

269

avatar image

Hi Experts,

I have a requirement two combine two xml responses into one xml payload. Here, i stored one xml into DataStore and other is in payload(which we have receiving to sender).

I'm trying with parallel multicast, join and Gather but not getting it.

Please suggest how to merge 2 payload into single payload.

Thanks and Regrads,

Md.Thouheed

1.jpg (52.4 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Sriprasad Shivaram Bhat
Dec 10, 2017 at 03:47 PM
0

Hello Md,

It should work,could you please check the visibility set in the DataStore.

  1. If you are creating an entry outside the DataStore and want to call it in above IFlow then you have to set the DataStore visibility global in both the IFows.
  2. If you are setting the DataStore in same IFlow and want to call it on later stage in same IFlow then set the visibility to "Integration Flow".

How to set Visibility in DataStore:

Hope it helps!

Regards,

Sriprasad Shivaram Bhat


Share
10 |10000 characters needed characters left characters exceeded
Mohammad Thouheed Dec 11, 2017 at 05:22 AM
0

Hi Sriprasad,

Thanks for replying,

We are able to fetch data from data store. however we are trying to add this data with new response data.

data read from DS is:

<a>abc</a>
<b>xyz</b>

New response data to be merged is:

<?xml version="1.0" encoding="utf-8"?>
<Root>

<x>hgh</x>

<y>jhsd</y>

</Root>

Now I want to merge and get the below output:

<?xml version="1.0" encoding="utf-8"?>
<Root>

<a>abc</a>
<b>xyz</b>

<x>hgh</x>

<y>jhsd</y>

</Root>

Please suggest your ideas.

Regards,
Thouheed

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hello Md,

I have tried the above scenario it works perfectly fine.I followed the below.

1) Confirmed that there is a entry in DataStore from where I pull the data in Second IFlow.

2) Post cross checking triggered IFlow which combines the data from IFlow 1 and IFlow 2

Below is the Merged data:

<?xml version="1.0" encoding="UTF-8"?>
<multimap:Messages xmlns:multimap="http://sap.com/xi/XI/SplitAndMerge">
	<multimap:Message1>
		<Root_MAIN>
			<Record>
				<FieldM1>Praveen</FieldM1>
				<FieldM2>T</FieldM2>
				<FieldM3>Reddy</FieldM3>
				<FieldM4>2211</FieldM4>
			</Record>
		</Root_MAIN>
	</multimap:Message1>
	<multimap:Message2>
		<Record_DS>
			<Record>
				<Field1>Sriprasad</Field1>
				<Field2>Shivaram</Field2>
				<Field3>Bhat</Field3>
				<Field4>2210</Field4>
			</Record>
		</Record_DS>
	</multimap:Message2>
</multimap:Messages>

Also give a try removing those Content modifier after get if you are not using them for anything.

If you want to get it to some other format you can do message mapping after Gather and transform it.

Regards,

Sriprasad Shivaram Bhat

0

Thanks Sriprasad, Great now its working fine.

Thanks and Regrads,

Md.Thouheed

0