cancel
Showing results for 
Search instead for 
Did you mean: 

Many to one mapping

former_member203631
Participant
0 Kudos

Hi,

I have a scenario where in the source stycture is as:

<seg1>

<a></a>

<b></b>

</seg1>

<seg2>

<a></a>

<b></b>

</seg2>

<seg3>

<a></a>

<b></b>

</seg3>

<seg4>

<a></a>

<b></b>

</seg4>

<seg5>

<a></a>

<b></b>

</seg5>

and target structure as,

<Header>

<a></a>

<b></b>

</Header>

<Body>

<a></a>

<b></b>

</Body>

<Line>

<a></a>

<b></b>

</Line>

Here I need to map

seg1 to Header,

seg2 to Body,

seg3,seg4 and seg5 needs to map to Line.

So how to achieve this as I am able to assign only one seg at a time to Line.

Please provide your valuable suggestions/ideas.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

duplicate <Line> segment in target structure. and then map <Seg3>,<Seg4> and <Seg5> individually to the seperate <Line> segments

Edited by: Kausik M on Mar 24, 2008 10:44 AM

Answers (6)

Answers (6)

Former Member
0 Kudos

hi check the below link for reference

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/b4b4bca6-0301...

note: reward points if found helpfull

regards

chadrakanth.k

GabrielSagaya
Active Contributor
0 Kudos

For this type of mapping you can opt XSLT mapping

assume source.xml contains

<source>

<seg1/>

<seg2/>

<line1/>

<line2/>

<line3/>

</source>

target.xml contains

<target>

<header>seg1</header>

<body>seg2</body>

<line>

<line1>line1</line1>

<line2>line2</line2>

<line3>line3</line3>

</line>

</target>

<?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="UTF-8" indent="yes"/>

<xsl:template match="/">

<source>

<!-- iterate on each group -->

<xsl:variable name="header">

<xsl:value-of select="$source/seg1"/>

</xsl:variable>

<xsl:variable name="body">

<xsl:value-of select="$source/seg2"/>

</xsl:variable>

<xsl:variable name="line">

<xsl:value-of select="$source/line1"/>

<xsl:value-of select="$source/line2"/>

<xsl:value-of select="$source/line3"/>

</xsl:variable>

<!-- Generate the final XML file -->

<target>

<Header>

<xsl:value-of select="$header"/>

</Header>

<Body>

<xsl:value-of select="$body"/>

</Body>

<Line>

<xsl:value-of select="$line"/>

</Line>

</target>

</xsl:template>

</xsl:stylesheet>

Former Member
0 Kudos

Hi

Please have a look at the following link.

/people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi

Refer --N to 1 Mapping using XSLT

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30ac53f2-21d7-2a10-afa2-ce1a0577...

Thanks

Swarup

ranjit_deshmukh
Active Participant
0 Kudos

Let me understand ur requirement in little bit more detail:

as per your explanation you need to create 3 diff. messages having the same Header and Body but different Line items right?

Ranjit

aashish_sinha
Active Contributor
0 Kudos

Hi,

Multi-mapping and BPM (integration process) always use to go hand-in-hand. Since SPS14, this isn’t true anymore. In the case of message splits (1:n transformations), multi-mappings can now be created and used in non-BPM scenarios. Referred to in many different ways, but most commonly as mapping-based message splits, this new enhancement affords SAP NetWeaver XI developers an opportunity to take BPM out of the equation for message split based scenarios.

/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible without BPM

Regards

Aashish Sinha

PS : reward points if helpful

Former Member
0 Kudos

Hi,

Check this Logic

/people/pooja.pandey/blog/2005/07/27/idocs-multiple-types-collection-in-bpm

Regards

Seshagiri

former_member203631
Participant
0 Kudos

can't we ahieve this with out using BPM?

ranjit_deshmukh
Active Participant
0 Kudos

Hi,

is you r problem solved?

if so can you please close the thread?

Ranjit