on 10-15-2005 12:20 AM
I have a mapping question. I am trying to map the following structure: How do I achieve the creation of one node <Invoice_Main> if Invoice node exist in input.
<Vendor>
<Invoice></Invoice>
<Invoice></Invoice>
</Vendor>
to output structure
<Vendor>
<Invoice_Main>
<Invoice_Detl></Invoice_Detl>
<Invoice_Detl></Invoice_Detl>
</Invoice_Main>
</Vendor>
I check If Invoice Node exists and then use CreateIF to create Invoice_main Node.. This works fine for first record, but for the second record the creation of Invoice_detl node fails.
Hi SSG
Solution for your requirement using XSLT is very straightforward.
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>
<xsl:template match="/Vendor">
<Vendor>
<xsl:if test="count(Invoice) > 0">
<Invoice_Main>
<xsl:for-each select="Invoice">
<Invoice_Detl>
<xsl:value-of select="."/>
</Invoice_Detl>
</xsl:for-each>
</Invoice_Main>
</xsl:if>
</Vendor>
</xsl:template>
</xsl:stylesheet>
cheers
Sameer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to use <b>SplitByValue</b> function.
http://help.sap.com/saphelp_erp2004/helpdata/en/21/3bb8c495125e4eb5969f0377885fe0/frameset.htm
regads
Shravan
User | Count |
---|---|
95 | |
11 | |
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.