Skip to Content
0
Aug 09, 2020 at 04:53 PM

Enrich/Combine the message using join and gather in CPI

8432 Views

Hi Experts,

I have requirement where I am calling two different systems fetching the data.

Flow -

Response XML from Step-1

<EmployeeTime>
	<EmployeeTime>
		<ABC>xyz</ABC>
		<userId>100050</userId>
		<ABC1>xyz1</ABC1>
	</EmployeeTime>
	<EmployeeTime>
		<ABC>xyz</ABC>
		<userId>100060</userId>
		<ABC1>xyz1</ABC1>
	</EmployeeTime>
	<EmployeeTime>
		<ABC>xyz</ABC>
		<userId>100070</userId>
		<ABC1>xyz1</ABC1>
	</EmployeeTime>
</EmployeeTime>

Response XML from Step-2

<n0:ZHTR_LEAVE_SAL_ADVANCEResponse xmlns:n0="urn:sap-com:document:sap:rfc:functions" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
	<E_LEAVEDATA>
		<item>
			<PERNR>100050</PERNR>
			<AMOUNT>0.0</AMOUNT>
			<DAYS/>
			<DATE>0000-00-00</DATE>
		</item>
		<item>
			<PERNR>100060</PERNR>
			<AMOUNT>0.0</AMOUNT>
			<DAYS/>
			<DATE>0000-00-00</DATE>
		</item>
		<item>
			<PERNR>100070</PERNR>
			<AMOUNT>0.0</AMOUNT>
			<DAYS/>
			<DATE>0000-00-00</DATE>
		</item>
	</E_LEAVEDATA>
</n0:ZHTR_LEAVE_SAL_ADVANCEResponse>

I am using gather to combine these two message, however, I am not getting the desired results.

My requirement is to get the output as

<EmployeeTime>
	<EmployeeTime>
		<ABC>xyz</ABC>
		<userId>
			<PERNR>100050</PERNR>
			<AMOUNT>0.0</AMOUNT>
			<DAYS/>
			<DATE>2020-02-29</DATE>
		</userId>
		<ABC1>xyz1</ABC1>
	</EmployeeTime>
	<EmployeeTime>
		<ABC>xyz</ABC>
		<userId>
			<PERNR>100060</PERNR>
			<AMOUNT>0.0</AMOUNT>
			<DAYS/>
			<DATE>2020-02-29</DATE>
		</userId>
		<ABC1>xyz1</ABC1>
	</EmployeeTime>
	<EmployeeTime>
		<ABC>xyz</ABC>
		<userId>
			<PERNR>100070</PERNR>
			<AMOUNT>0.0</AMOUNT>
			<DAYS/>
			<DATE>2020-02-29</DATE>
		</userId>
		<ABC1>xyz1</ABC1>
	</EmployeeTime>
</EmployeeTime>

can anyone please guide how to put the condition in gather to achieve this.

Regards,

Akash

Attachments

0908cpi.png (39.8 kB)
0908cpigather.png (20.6 kB)