on 11-26-2012 2:34 PM
Hi All,
I am working on IDoc to File scenario using xslt mapping.
There is a requirement to map the corresponding partner ids based on partner functions say
If for each segment E1ADRM1 if PARTNER_Q =WE then map the corresponding partner id to a tag .
Below is the xslt code I am using but it is taking only the first partner id not the corresponding one
<xsl:for-each select="$E1EDL20/E1ADRM1[PARTNER_ID='WE']">
<ShipToLocationCode>
<xsl:value-of select="$E1EDL20/E1ADRM1/PARTNER_ID"/>
</ShipToLocationCode>
</xsl:for-each>
Please suggest me how to take the corresponding partner.
Thanks
Hi Swmya,
Im sorry, but i dont understand your requeriment. You are only taking the partner PARTNER_ID='WE'' then is normal that your <xsl:value-of select="$E1EDL20/E1ADRM1/PARTNER_ID"/> select always the partner with the id WE.
Could you share an example?
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have posted the incorrect code by mistake. My code is:
<xsl:for-each select="$E1EDL20/E1ADRM1[PARTNER_Q='WE']">
<ShipToLocationCode>
<xsl:value-of select="$E1EDL20/E1ADRM1/PARTNER_ID"/>
</ShipToLocationCode>
</xsl:for-each>
The above code is not taking the corresponding partner ID which has Partner=WE, instaead it is taking whatever is the first Partner_ID in the IDoc.
Please suggest a code to take the corresponding one.
Thanks
HI Sowmya,
With this source XML:
<?xml version="1.0" encoding="UTF-8"?>
<E1EDL20>
<E1ADRM1>
<PARTNER_Q>WE</PARTNER_Q>
<PARTNER_ID>ONE</PARTNER_ID>
</E1ADRM1>
<E1ADRM1>
<PARTNER_Q>HE</PARTNER_Q>
<PARTNER_ID>TWO</PARTNER_ID>
</E1ADRM1>
<E1ADRM1>
<PARTNER_Q>WE</PARTNER_Q>
<PARTNER_ID>THREE</PARTNER_ID>
</E1ADRM1>
</E1EDL20>
If i use this XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<root>
<xsl:for-each select="E1EDL20/E1ADRM1">
<xsl:if test="./PARTNER_Q='WE'">
<ShipToLocationCode>
<xsl:value-of select="./PARTNER_ID"/>
</ShipToLocationCode>
</xsl:if>
</xsl:for-each>
</root>
</xsl:template>
</xsl:stylesheet>
I get the next XML:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<ShipToLocationCode>ONE</ShipToLocationCode>
<ShipToLocationCode>THREE</ShipToLocationCode>
</root>
I hope this helps you.
Regards
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.