cancel
Showing results for 
Search instead for 
Did you mean: 

mapping problem

Former Member
0 Kudos

hi

i have source structure like this

<records_mt>

<data> 1 to inbound

field1

field 2

field3

<data2> 1 to unbound

field4

field5

field6

my target structure is

<records_mt>

<data_target> 1 to inbound

field1

field 2

field3

field4

field5

field6

so if data1 comes one time data2 comes 3 times in the incoming message then in the target message i should have 3 records and every record should have field1, field2 and field3. I heard that we cna do this using context mapping. can anybody give me the exact mapping?

thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member181962
Active Contributor
0 Kudos

Hi Sudhakar,

Map your <data2. node to <data_target> node.

then for field1 field2 field3 use the useOneAsMany node function

The three inputs for Use One as many are

1) field1

2) <data2>

3) <data3>

GIve the output of useOneAsmany to field1 field2 field3 of the target respectively.

Map the field4 field5 field 6 normally.

Regards,

Ravi Kanth Talagana

Former Member
0 Kudos

hi

there is no data3 in my strcuture and also if there more than 3 fields under data1 and data2 how the mapping looks

former_member181962
Active Contributor
0 Kudos

Sorry, I mean map data2 both the times (2nd and 3rd argument of useOneAsMany)

Regards,

Ravi

Former Member
0 Kudos

hi ravi

so u mean to say

field1->

data2->

data2-> use one as many field1 of tartget

sameway for field2 and field3 of the target . am i right?

Edited by: sudhakar murthy on May 13, 2009 3:22 PM

Former Member
0 Kudos

Hi,

Please follow up as mentioned in Ravis reply. Instead of <data3> use <data2> itself.

The relation between first input and second input to UseOneAsMany is number of context changes should be same and between second input and third input is number of values should be same. Keep this in mind while mapping. The output of UseOneAsMany will be like the first input values will be replicating as many number of times you having the values in the second input and context changes depends on the context changes in the third input.

For more explantion just go through help.sap.com documents which clearly depicts with example.

For <data1> whatever be the number of fields inside it u can use the same function since field1 corresponds to field1 only in target.So even if number of fields in <data1> increased also what is the problem you forseeing in it I am not getting.

Regards,

Vineetha.

Former Member
0 Kudos

Hi,

No.we can not use like.

field1->
data2->
data2-> use one as many field1 of tartget

Because field one will form in single context.So you can not get field1 value in all the Target structure.But you need to populate field1 value in all the target structure.So you should use like below.

field1->
data2->
data2->SplitbyValue(each)-- use one as many field1 of tartget

Regards,

Prakasu.M

Answers (3)

Answers (3)

jyothi_anagani
Active Contributor
0 Kudos

Hi Sudhakar,

Do like this.


data2------------>data_target


field1------\
data2--------->UseOneAsMany------>field1
data2------/


field2------\
data2--------->UseOneAsMany------>field2
data2------/


field3------\
data2--------->UseOneAsMany------>field3
data2------/


field4------->field4


field5------->field5


field6------->field6

Thanks.

Former Member
0 Kudos

hi

i am getting the out put like this. i have data2 two times

<data_target>

field1

field2

field3

field4

field5

field6

<data_target>

<data_target>

field3

field4

field5

<data_records>

the second time field1, 2,3 are not repeated. am i missing somehithg

Former Member
0 Kudos

Hi,

Map like below.

field1---use one as many---target(field1)
   data2--
   data2--splitbyvalue(each value)--

field1(source) -


target(field1)

same way map the fields comes in data1 to target. like field 2,field3

Directly map what are fields comes in data2 to target. like field5,field6

field4---target(field4)

This will work data1 must come in one time and data2 structure comes in multiple times.

Regards,

Prakasu.M

Edited by: prakasu on May 13, 2009 6:45 PM

Former Member
0 Kudos

Hi,

Use one as many in the mapping.

Map like below.

field1---use one as many---target(field1)
   data2--
   field4 (or)[data2--splitbyvalue(each value)]--

Regards,

Prakasu.M

Edited by: prakasu on May 13, 2009 3:37 PM