Hi I am mapping from IDoc to an XML format. The IDoc is a PO Documnet and has the following structure.
I need help in mapping OrderLineItems
Suppose, for line-num 1 the ordered-qty is 50 and we have to ship them in two ( first schedule date 30, next schedule 20 ) installments i.e., we have two schedules, schedule id 1, req-qty 30, schedule-dates schedule-date is 2013Jan01, and the remaining 20 items we have to ship them in next schedule i.e., schedule id 2, req-qty 20, schedule-date schedule-date is 2013Feb01.
And for line-num 2 say we have only one schedule and the ordered-qty is 30, schedule 1, req-qty 30 , schedule-dates schedule-date is 2013Jan01.
Sample data in Idoc is
PO
Sender
Receiver
Line-item
Line-item[0]
line-num 1
ordered-qty 50
Schedule
Schedule[0]
id 1
req-qty 30
Schedule-dates
Schedule-dates[0]
Schedule-date 2013Jan01
Schedule[1]
id 2
req-qty 20
Schedule-dates
Schedule-dates[0]
Schedule-date 2013Feb01
Line-item[1]
line-num 2
ordered-qty 30
Schedule
Schedule[0]
id 1
req-qty 30
Schedule-dates
Schedule-dates[0]
Schedule-date 2013Jan01
My requirement is:
For each shedule ship date a new OrderLineItem needs to be created. The line information will repeat each time. One OrderLineItem group should be sent per unique Line Number and Line Item Schedule.
Yes these 3 options should cover the mapping ease for the req you mentioned →
You need to have in the output array of Loop over schedule-dates.
Or you need to have a variable as indices that will be incremented whenevar a OrderLineItem is created.
Or you can have a single OrderLineItem doc mapped and then it can be appended to the output structure using via appendToDocumentList with in the loop (make sure you drop the temp items here) a close debugging the pipeline is required on this before/ after step…