cancel
Showing results for 
Search instead for 
Did you mean: 

How to Split IDOC when LineItems exceed count of 999

Former Member
0 Kudos

Hi! Gurus

I need to address a functional requirement in File to IDOC scenario to keep the Line Items under 999 for each IDOC. IF the IDOC crosses more than 999 LineItems - the PI mapping should create a 2nd IDOC and carry forward the rest of the LineItems in the 2nd LineItem.


Requirement:-

  1. Header Node will be mapped to IDOC Node - Whenever a particular Header crosses 999 LineItems - There should be a second IDOC created.
  2. The 2nd IDOC needs to have the remaining LineItems.
  3. Example: A message has 1200 Line Items - 1st IDOC has 999 LineItems & 2nd IDOC has the remaining 201 LineItems.

Mapping Rules:-

1. <Header> will be mapped to <IDOC> -> There will be 1 IDOC per Header / However, if Header has more than 999 - 2nd IDOC will be created with the remaining LineItems.

2. <LineItem> will be mapped to <E1EDP01> (IDOC Line Item) - Every LineItem  is replicated on the <E1EDP01> segment under thier respective Header.

Please, find below the source structure:-

<Header>

     <Carton_Number></Carton_Number>

     <Ship_Date></Ship_Date>

     <LineItem>

          <Quanity></Quanity>

          <Prepack></Prepack>

          <Order_No></Order_No>

     </LineItem>

</Header>

Please, help me with the best approach for the above requirement. Your help is greatly appreciated!!

Thank you,

Ritu



Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ritu

Please see the below thread

Thanks

Answers (1)

Answers (1)

sahithi_moparthi
Contributor
0 Kudos


Hi,

you can acheive by using an UDF.In UDF first make a count of the Header upto 999,when it reaches to the 999 then make a contextChange.