cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

henrique_pinto
Active Contributor
0 Kudos

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.

VijayKonam
Active Contributor
0 Kudos

XSLT or Java mapping are must for such a mapping. If the node name is not same, In graphical mapping you will have to create each node manually in the schema.

VJ

Former Member
0 Kudos

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

Answers (0)