on 05-17-2006 2:07 PM
Hi Guys,
i have one XSLT mapping issue. Mapping scenario is from IDoc to file.
IDoc structure is as below
<ZLOIPRO1>
<E1AFKOL>
<A></A>
<B></B>
<E1RESBL>
<MATNR>1</MATNR>
<CHARG>1</CHARG>
<ZSBL>
<MTART>ABC</MTART>
</ZSB>
</E1RESBL>
<E1RESBL>
<MATNR>2</MATNR>
<CHARG>2</CHARG>
<ZSBL>
<MTART>ZHA1</MTART>
</ZSB>
</E1RESBL>
<E1RESBL>
<MATNR>3</MATNR>
<CHARG>3</CHARG>
<ZSBL>
<MTART>ZHA1</MTART>
</ZSB>
</E1RESBL>
</E1AFKOL>
</ZLOIPRO1>
As you can see 'E1RESBL' is repeatative. Now my issue is i need to select 'MATNR' and 'CHARG' from 'E1RESBL' segment when first occurance of 'ZSBL/MTART' with value 'ZHA1' appears. i.e. my output would be MATNR = 2 and CHARG = 2.
I hope i am clear. Please let me know if any solution for this.
Hi,
Try this
<xsl:if test="./ZSBL/MTART == 'ZHA1'">
<xsl:for-each select="./E1RESBL">
<MATNR>
<xsl:value-of select="./MATNR"/>
</MATNR>
<BATCH>
<xsl:value-of select="./CHARG"/>
</BATCH>
</xsl:for-each>
</xsl:if>
You might need to do some changes in the above.
Thanks,
Prakash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi YashPal,
First you can search for this in the entire document. Once you found you can write the output as required.
For this you can use <xsl:if> statements etc.
also go thru some examples http://www.w3schools.com/xsl/
Hope this helps,
Regards,
Moorthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.