cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping query

Former Member
0 Kudos

Hi,

The mapping requirement that I am doing is

Source field:E1EDP05:sourcefield

Target field:targetfield

Mapping requirement:Take sourcefield from first E1EDP05 segment

Can you please help me?

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

former_member854360
Active Contributor
0 Kudos

Hi,

You can use standard function copyvalue

You can use CopyValue() to copy the value of a position in the source structure and assign it to a target field

see this link for an perfect example

http://help.sap.com/saphelp_nw04/helpdata/en/26/d22366565be0449d7b3cc26b1bab10/content.htm

rajasekhar_reddy14
Active Contributor
0 Kudos

adding one more point to Debashish reply,

suppose if your source E1EDPO5 segment not created then copy value throw exception, so you have to use map with defalut or someother approch .

Regards,

Raj

former_member854360
Active Contributor
0 Kudos

Yes As per Raja's suggestion you can use MapwithDefault with CopyValue Also. it will be good.

Former Member
0 Kudos

Hi All,

Thanks for your replies.

The node E1EDP05 can repeat for n number of times and the condition is that the value of the sourcefield should be taken from the first occurrence of the node E1EDP05 and not the first occurrence of sourcefield.

As per your replies it should be

sourcefieldcopyvalue(0)-mapwithdefault--targetfield

and the context of the sourcefield should be E1EDP05,right?

Will this work for the mapping condition?

Please help me.

Thanks in advance

Former Member
0 Kudos

Hi,

Use source > ( raise the context to the level below which you expect the value) CollapseContext>SplitByValue-->Target.

The above mapping will give you the one output Node/Field if you have multiple E1EDP05's.

If you raise the source cotext to E1EDP01 for all lineitems from the source - one target Node/Field will be created for each Linetiem.

Cheers,

Sunil.

former_member854360
Active Contributor
0 Kudos

Hi,

If for every E1EDP05 first field you want to take then context should be E1EDP05 if in total IDOc if you want to take only one occurecce then context should be IDOC level

Former Member
0 Kudos

Hi Debashish,

Thanks for the reply.

If for every E1EDP05 first field you want to take then context should be E1EDP05 if in total IDOc if you want to take only one occurecce then context should be IDOC level

The occurrence should be multiple times.

so how will it be?

Thanks in advance

former_member854360
Active Contributor
0 Kudos

Hi ,

Set the context of the field to Highest means IDOC LEVEL.

rajasekhar_reddy14
Active Contributor
0 Kudos

use below logic.

sourcefieldremovecontextscopyvalue(0)-mapwithdefaulttargetfield

Former Member
0 Kudos

Hi ,

Thanks for your replies.

Also,one more thing,the sourcefield from the first occurrence of the node should be taken.

sourcefield--removecontexts--copyvalue(0)---mapwithdefault--targetfield

After that the context of the sourcefield should be IDOC LEVEL or E1EDP05?

Please help me.

Thanks in advance

Edited by: Shweta Kullkarni on Jul 19, 2011 10:19 AM

former_member854360
Active Contributor
0 Kudos

It will remove al the Context. It is same to change context of the field to IDOC level

if you use removecontext then no need to set the context of sourcefield to IDOC level.

If you set the context of the source field to IDOC level then no need to use removecontext.

Former Member
0 Kudos

Hi Debashish,

Thanks for the reply.

The mapping should be like this

sourcefieldremovecontexts(no need to set the context of sourcefield to IDOC level)copyvalue(0)-mapwithdefaulttargetfield

or

sourcefield(need to set the context of sourcefield to IDOC level)--copyvalue(0)-mapwithdefault--targetfield

right?

Thanks in advance

rajasekhar_reddy14
Active Contributor
0 Kudos

>

> sourcefieldremovecontexts(no need to set the context of sourcefield to IDOC level)copyvalue(0)-mapwithdefaulttargetfield

>

use above mapping logic.. this is the right one for all conditions.

former_member854360
Active Contributor
0 Kudos

Yes you are right

Answers (2)

Answers (2)

Former Member
0 Kudos

answered

markangelo_dihiansan
Active Contributor
0 Kudos

Solution already provided by above poster.

Edited by: Mark Dihiansan on Jul 19, 2011 8:32 AM