Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Mapping from File to IDoc with multiple Idocs and multiple line items?

Hi All,

Need some help with mapping, requirement as below: I have a flat file with multiple records, need to create multiple idocs per each separate order in flat file with as many line items.

Order_1 field-1 field-2 field-3 field-4

Order_1 field-1 field-2 field-3 field-4

Order_2 field-1 field-2 field-3 field-4

Order_2 field-1 field-2 field-3 field-4

Order_3 field-1 field-2 field-3 field-4

Order_3 field-1 field-2 field-3 field-4

I have imported IDoc changed to 1:Unbounded, able to create multiple Idocs based on separate order from flat file.

Order_No - removeContexts - splitByValue(ValueChanged) - collapseContexts - exists - creatIf - IDOC

Now I am having hard time creating a line item segment E1EDP01. I want to have Idoc created below way:

IDoc-1 (Order_1)

E1EDP01

E1EDP01

IDoc-2 (Order_2)

E1EDP01

E1EDP01

IDoc-3 (Order_3)

E1EDP01

E1EDP01

I am getting multiple IDocs created. Please help me to create mutlieple line items under each Idoc. Please be speficic about the node funtions to be used, because I tried many times with different combinations, didn't work.

Regards,

N@v!n

Former Member
replied

Hi Navin,

Create your source structure like below

<Order>1 to unbounded

<Order_No>

<field1>

<field2>

<field3>

<field4>

</oder>

to create mutiple IDocs based on order number,use below logic

Order_No-->removecontexts--->sort--->splitbyvalue(Valuechange)--->collapsecontext-->Idoc

use below logic for E1EDPO1,

Order----->removecontexts------>
                                                                                formatByexample------>E1EDP01
 Order_No-->removecontexts--->sort--->splitbyvalue(Valuechange)-------->

try above logic and let me know if you any issues.

Regards,

Raj

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question