Hi Ramu!
I consider XSL transformation to be the most suitable for your requirement.
Here is an example template:
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:q1="http://www.abc.com/yellowpages/businesspartner/1_1" exclude-result-prefixes="xs q1" version="1.0"> <xsl:template match="/"> <DEBMAS06> <xsl:apply-templates select="/q1:SyncBusinessPartner/DataArea/BusinessPartner[InternationalVersion/Address/AddressType = 'CA']"/> </DEBMAS06> </xsl:template> <xsl:template match="BusinessPartner"> <IDOC BEGIN="1"> <EDI_DC40 SEGMENT="1"> </EDI_DC40> <xsl:apply-templates select="./Banking"/> </IDOC> </xsl:template> <xsl:template match="Banking"> <E1KNBKM SEGMENT="1"> </E1KNBKM> </xsl:template> </xsl:stylesheet>
For your first input result looks like:
<?xml version="1.0" encoding="utf-8"?> <DEBMAS06> <IDOC BEGIN="1"> <EDI_DC40 SEGMENT="1"/> <E1KNBKM SEGMENT="1"/> </IDOC> <IDOC BEGIN="1"> <EDI_DC40 SEGMENT="1"/> <E1KNBKM SEGMENT="1"/> </IDOC> </DEBMAS06>
I guess you could enhance this template furher to build desired IDoc structures.
Regards, Evgeniy.
Add comment