on 12-04-2020 11:53 PM
Hi,
I am trying to merge two different formats of xmls (from SuccessFactors and ERP) to one single message in XSLT mapping. I used join and gather to get both message to single xml.
XML from Successfactors has below format
<?xml version="1.0" encoding="UTF-8"?>
<PerPerson>
<PerPerson>
<personIdExternal>12345</personIdExternal>
<name>Pradeep</name>
....
</PerPerson>
</PerPerson>
XML from ERP using RFC adaptor has format
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<rfc:ZHR_GET_EMP_BENEFIT_DETAILS.Response xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
<LT_0167>
<item>
<PERNR>00012345</PERNR>
<DOB>01/01/2020</DOB>
....
</item> </LT_0167> </rfc:ZHR_GET_EMP_BENEFIT_DETAILS.Response>
After Join & Gather, both are in single XML like below with <multimap:messages> tags
<?xml version='1.0' encoding='UTF-8'?>
<multimap:Messages xmlns:multimap="http://sap.com/xi/XI/SplitAndMerge">
<multimap:Message1>
<PerPerson><PerPerson>
<personIdExternal>12345</personIdExternal>
</PerPerson></PerPerson>
</multimap:Message1>
<multimap:Message2>
<rfc:ZHR_GET_EMP_BENEFIT_DETAILS.Response xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
<LT_0167>
<item>
<PERNR>00012345</PERNR></item>
<DOB>01/01/2020</DOB>
....
</LT_0167>
</rfc:ZHR_GET_EMP_BENEFIT_DETAILS.Response>
</multimap:Message2>
</multimap:Messages>
How to write XSLT for above to combine tags under multipmap message1 (SF data) & maultipmap message 2 (ERP data) to get final output as below with same PersonalID & PERNR?
Required Output:
<?xml version="1.0" encoding="UTF-8"?>
<PerPerson xmlns:xs="http://www.w3.org/2001/XMLSchema">
<PerPerson>
<EmployeeID>12345</EmployeeID> "from multimap:message1 & multimap:message 2 comparison / same value
<DOB>01/01/2020</DOB> "from multimap:message 2
<Name>Pradeep</Name> "from multimap:message 1
I am on the same boat, how did you solved this? Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sagar,
I have achieved it through groovy script code. You can see my code and question to finetune my code in other forum with below link.
hope it helps.
-Pradeep
Hi pradeepbondla,
I Suggest you another way Where you can use a Graphical Mapping for achieving it. Just Create a XSD Structure how you want as a output and do the mapping from the multi mapping (Strcture From the Source) to a single structure.
Regards,
Vijender
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Vijender,
I am new to CPI / XSD / XSTL. So you are suggesting to user "Message Mapping" pallet right after "Gather" (which gives multi message xml) to make it into plane, single structure xml by removing multimessage tags? and then send that as output to XSLT (I am using XSLT for some other calculations already)? Please check my iFlow image and suggest.
Thanks again.
Pradeep
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.