cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT Mapping issue

Former Member
0 Kudos

Hello Friends,

I have got one scenario in which XSLT mapping is used.The third party file is mapped to IDoc INVOIC01.After the development of the mapping code,I got the result as below in the XML Spy

  • <E1EDP01 SEGMENT="1">* first segment

<POSEX>0</POSEX>

<E1EDP02 SEGMENT="1"> Subsegment1

<QUALF>001</QUALF>

</E1EDP02>

<E1EDP04 SEGMENT="1"> Subsegment2

<MWSKZ></MWSKZ>

<MSATZ>22.00</MSATZ>

<MWSBT>6.660</MWSBT>

</E1EDP04>

<E1EDP04 SEGMENT="1">Subsegment2

<MWSKZ></MWSKZ>

<MSATZ>22.00</MSATZ>

<MWSBT>13.330</MWSBT>

</E1EDP04>

</E1EDP01>

<E1EDP01 SEGMENT="1">

<POSEX>0</POSEX>

<E1EDP02 SEGMENT="1">

<QUALF>001</QUALF>

</E1EDP02>

<E1EDP04 SEGMENT="1">

<MWSKZ></MWSKZ>

<MSATZ>22.00</MSATZ>

<MWSBT>6.660</MWSBT>

</E1EDP04>

<E1EDP04 SEGMENT="1">

<MWSKZ></MWSKZ>

<MSATZ>22.00</MSATZ>

<MWSBT>13.330</MWSBT>

</E1EDP04>

</E1EDP01>

But the expected result is as below:

<E1EDP01 SEGMENT="1">

<POSEX>0</POSEX>

<E1EDP02 SEGMENT="1">

<QUALF>001</QUALF>

</E1EDP02>

<E1EDP04 SEGMENT="1">

<MWSKZ></MWSKZ>

<MSATZ>22.00</MSATZ>

<MWSBT>6.660</MWSBT>

</E1EDP04>

</E1EDP01>

<E1EDP01 SEGMENT="1">

<POSEX>0</POSEX>

<E1EDP02 SEGMENT="1">

<QUALF>001</QUALF>

</E1EDP02>

<E1EDP04 SEGMENT="1">

<MWSKZ></MWSKZ>

<MSATZ>22.00</MSATZ>

<MWSBT>13.330</MWSBT>

</E1EDP04>

</E1EDP01>

ie For each E1EDP01 segment,there should be only one E1EDP04 segment.

Please help me in this regard how to code the xslt map for this...

Thank you

Sam

Edited by: Guest on Apr 4, 2008 1:00 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

For E1EDP04 segment you can drive from E1EDP01 segment That mean loop for each E1EDP01

Mapping would be like this

<xls: for each select = " //E1EDP04"

<item value = "E1EDP01"

.....

<xls:for each/>

<xls: for each select = " //E1EDP04"

<item value = "E1EDP02"

.........

<xls:for each/>

<xls: for each select = " //E1EDP04"

<item value = "E1EDP04"

.................

<xls:for each/>

Former Member
0 Kudos

Hi friends,

Thanks for your response.

My query is :-I require how to implement SplitByValue function logic in XSLT Mapping.

How to do that....Please if you know tell me

Thanks n Regards

Sam

Former Member
0 Kudos

Hi,

Trying following code, anyway, this is not what splitByValue can achieve.

Liang


<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="/">
<xsl:for-each select="//E1EDK04">
<E1EDP01>
 <xsl:copy-of select="../E1EDP02/." />
 <xsl:copy-of select="." />
</E1EDP01> 
</xsl:for-each>         
</xsl:template>            
</xsl:stylesheet>

Edited by: Liang Ji on Apr 5, 2008 7:31 PM

aashish_sinha
Active Contributor
0 Kudos

Hi,

Please refer these two blogs and you will be able to complete your XSLT mapping of given xml.

/people/aashish.sinha/blog/2008/01/17/step-150-by-150-step-simple-approach-for-xslt-mapping

/people/aashish.sinha/blog/2008/01/21/xslt-mapping-for-multiple-segments-of-xml

Do exactly as given in these blogs.

Regards

Aashish Sinha

PS : reward points if helpful

Former Member
0 Kudos

Hello Ashish,

Thanks for your reply.

The third party system is th sender and sends XSD file which contains header detail (with multiple tax details in it) and multiple line Item details (which contains one tax details per lineitem).

ie if there are two line items then each line item should have one tax details (1st tax detail in header should match with 1st tax details of linitem, and 2nd should match with second line item tax details..etc)

<?xml version="1.0" encoding="UTF-8"?>

<INVOIC01 xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<IDOC BEGIN="1">

<E1EDK04 SEGMENT="1">

<MWSKZ>VAT</MWSKZ>

<MSATZ>22.00</MSATZ>

<MWSBT>6.660</MWSBT>

</E1EDK04>

<E1EDK04 SEGMENT="1">

<MWSKZ>VAT</MWSKZ>

<MSATZ>22.00</MSATZ>

<MWSBT>13.330</MWSBT>

</E1EDK04>

<E1EDP01 SEGMENT="1">

<POSEX>0</POSEX>

<E1EDP04 SEGMENT="1">

<MWSKZ>VAT</MWSKZ>

<MSATZ>22.00</MSATZ>

<MWSBT>6.660</MWSBT>

</E1EDP04>

</E1EDP01>

<E1EDP01 SEGMENT="1">

<POSEX>0</POSEX>

<E1EDP04 SEGMENT="1">

<MWSKZ>VAT</MWSKZ>

<MSATZ>22.00</MSATZ>

<MWSBT>13.330</MWSBT>

</E1EDP04>

</E1EDP01>

</IDOC>

</INVOIC01>

I thinks this is like a copying th header segment details in the item details.

Please help me in ths regard

Thank you

Sam