Skip to Content

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

SAP PI 7.4 - Flat file to IDoc - New IDoc based on Key Field

Hi Everyone,

I'm having a bit of trouble with a flat file to IDoc ORDERS05 scenario and I would appreciate any advice you could give.

I have an incoming flat file and my message type which this file translates to is in the following format

Record            1:Unbounded 

----- ID             1:1

----- Material     1:1

----- Quantity    1:1

----- UOM         1:1

----- etc.


For every change of ID I need to create a new ORDERS05 IDoc.  I'm using Split by Value to achieve this and that does seem to work fine.


ID-->removeContexts-->SplitByValue[Value Change]-->collapseContexts->IDOC (IDoc Node 0:Unbounded)


The problem I have is the subsequent mapping of the line item segment E1EDP01 in the IDoc and it's occurrence.  I'm not sure what maps this this. I'm currently mapped it to Constant 1 which isn't correct. Fields like Material will be mapped in this segment


In an example where we have different IDs the scenario appears to work. When the ID's are the same only the first Material is populated into E1EDP01 - which is course is becuase the occurence is 1. If I map Record node to E1EDP01 it create's all instances of the segment in the first IDoc.


I know I probably need some sort of context mapping here and I've tried a few things but I'm failing to see what that is. I assume I can achieve this with the Record format above ?  I'm hoping I've not overlooked something obvious but the penny isn't dropping on this.


Here is an example to illustrate what I'm looking for


Record           

----- ID             800

----- Material     1234

----- Quantity    10

----- UOM         EA

Record           

----- ID             800

----- Material     5678

----- Quantity    10

----- UOM         EA

Record           

----- ID             810

----- Material     1234

----- Quantity    10

----- UOM         EA


For the above example I want two ORDERS05 IDocs.


+ First IDoc     with two E1EDP01 segments (one each for Material 1234 and 5678 respectively)

+ Second IDoc with one E1EDP01 segment  (Material 1234)



Any help you can give is much much appreciated.


Thanks you

JE

Tags:
replied

Hi Joel,

You are right when using SplitByValue on ValueChange.

Just check if you are using the right context in the below fields.

Material, quantity and UOM must use the ID context.

Let me know the results.

Regards,

Diego

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question