Skip to Content
avatar image
Former Member

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 15, 2009 at 01:45 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Vijayashankar Konam

      Hi Guys,

      Thanks for answers and confirming my thoughts, in the meantime I did a workaround with an intermediary mapping and a smaller data type where I create my structure, and then I map the nodes 1 to 1 with my Idocs. Although it is not the best way to do it it is working, but next time I will try the java mapping as suggested !

      Thanks,

      Best regards,

      GL