cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple headers and multiple line items

Former Member
0 Kudos

Hi All,

I am working on a soap to RFC synchronous scenario.

My requirement is input structure is coming as

<X_header1>(0 to unbounded)

<EBELN1>

<X_header2>

<EBELN2>

<X_Item1>(0 to unbounded)

<EBELN1>

<EBELP>

<X_Item2>(0 to unbounded)

<EBELN1>

<EBELP1>

<X_Item1>

<EBELN2>

<EBELP2>

    

I have to convert the structure to above structure to

Record

{

<X_header1>

<EBELN1>

<X_Item1>

<EBELP>

<X_Item2>

<EBELP1>

}


Record

{

<X_header2>

<EBELN2>

<X_Item1>

<EBELP2>

}


Record should repeat.


I am sorting the value EBELN. And using sortbykey for EBELP in the line item.The mapping is working for single header and single line item.when there is single header and mutiple line items the mappings is throwing exception.


Please suggest me how to handle this in graphical mapping.


Thanks,

--Ramya


Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186851
Active Contributor
0 Kudos

Hello Ramya,

Try the below logic

http://scn.sap.com/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-part-ii

Same has done been for master data records.

juan_vasquez2
Active Participant
0 Kudos

Try with this,

element key -> removeContexts -> sort -> splitByValue[value change]  --> for header

this generates one element for the key

then find details for each element, this sort the elements by key, and ubicate in the right position for respective header, see the picture, it is easy

elemento key ---> removeContexts ---> sort --> splitbyvalue[valuechange] --> (2)

                                                  |                 

detail -> removeContexts -> sortByKey(A) --->(2) formatByExample ---> splitByValue[each value] --> detail