Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

mapping: split different nodes into several occurence of a single one

Hello experts,

I would like to do the following mapping :

Source message :

<Employee1>

<P0000>

....

</P0000>

<P0001>

...

</P0001>

<Pxxxx>

...

</Pxxxx>

</Employee1>

And get this result in an Idoc :

<E1PITYP>

<P0000>

....

</P0000>

</E1PITYP>

<E1PITYP>

<P0001>

...

</P0001>

</E1PITYP>

<E1PITYP>

<Pxxxx>

....

</Pxxxx>

</E1PITYP>

I have tried to duplicate subtrees in my Idoc definition to map each node Pxxxx with a duplicate of field E1PITYP, but the Idoc definition is so big that I am lacking of java memory.

Do you have any other clue ?

Many thanks,

Best regards,

Guislain

Former Member
replied

For graphical mapping, there's no clue.

That's the proper way to do it (duplicate subtree in the target node).

With XSLT/Java mapping, maybe you could accomplish it with something more simple.

Something like:

...
<xsl:template match="/Employee">
   <IDOC_ROOT_TAG>
      <xsl:for-each select="child::node()">
         <E1PITYP>
            <xsl:copy-of select="."/>
         </E1PITYP>
      </xsl:for-each>
   </IDOC_ROOT_TAG>
</xsl:template>
...

Regards,

Henrique.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question