cancel
Showing results for 
Search instead for 
Did you mean: 

mapping

Former Member
0 Kudos

Hello friends,

here i am having a scenario like we will be getting a field in header which needs to be passed to multiple line items on the receiver.

Input structure

-


<Node>

-


A

-


B

<Node>

output structure is like

-


<Node1>

-


<Node2>

-


<Line Item1>

-


A

-


FLD1

-


FLD2

-


<Line Item1>

-


<Line Item2>

-


A

-


FLD3

-


FLD4

-


<Line Item2>

-


<Node2>

-


<Node3>

-


<Line Item3>

-


B

-


FLD5

-


FLD6

-


<Line Item3>

-


<Line Item4>

-


B

-


FLD7

-


FLD8

-


<Line Item4>

-


<Node3>

<Node1>

please let me know how to distribute a field to multiple fields in the receiver structure.

Thanks

Ramana.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

we can achive this by using advansed UDF.

take the header field and line item node as inputs to the udf.

In udf write the below code.

here a is line item node and b is header field.

for(int i=0;i<a.length;i++)

{

result.addValue(b(i));

}

Sreedhar Goud.

Edited by: sreedhar goud on Sep 4, 2008 7:47 AM

Edited by: sreedhar goud on Sep 4, 2008 7:47 AM

Edited by: sreedhar goud on Sep 4, 2008 7:48 AM

Edited by: sreedhar goud on Sep 4, 2008 7:51 AM

Answers (1)

Answers (1)

former_member187563
Contributor
0 Kudos

hi,

You have to use OneAsMany Node function in this case.

You can refer to:

http://help.sap.com/saphelp_nwpi71/helpdata/en/49/1ebc6111ea2f45a9946c702b685299/frameset.htm

in this you can see that fn standard functions and also check out MapExampleNestedTablesToFlatStructure in Example message mapping

regards

ujjwal kumar