cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Issue

Former Member
0 Kudos

Hi

I need help in resolving one of the mapping issue

Scenarios is file-to-IDOC ,

file structure

7/12/2014,USD,MANUAL,12,23,78,test1

7/12/2014,USD,MANUAL,12,23,79,test2

7/12/2014,USD,MANUAL,12,23,80,test2

7/12/2014,USD,MANUAL,12,23,81,test1

we need to create the IDOC based on the test field , we need to create the 2 IDOCS one for test1 and other for test2

for the line item segments we need to create as many items are there for test1 and test1 i.e 2 line items in each idocs

can u help in how we achive above req

thanks

venkat

Accepted Solutions (1)

Accepted Solutions (1)

Harish
Active Contributor
0 Kudos

Hi Venkat,

you can achieve this with graphical mapping.

First step to convert the flat file to XML using content conversion. use the below wiki as reference

Basic File Adapter Content Conversion - Process Integration - SCN Wiki

Datecountrydata1data2data3data4key
7/12/2014USDMANUAL122378test1
7/12/2014USDMANUAL122379test2
7/12/2014USDMANUAL122380test2
7/12/2014USDMANUAL122381test1

then in the message mapping create the IDOC with below logic

Key --> remove context --> Sort --> split by value change -->> collapse context --> IDOC

and all other values are needs to sortbykey using Key field.

Please refer the below wiki and blog

File to Multiple IDOC Splitting without BPM - Process Integration - SCN Wiki

regards,

Harish

Former Member
0 Kudos

Hi harish

Thanks for the reply.. i am able to achieve IDOC and Line segments mapping.. how we achive the same line item field mappings..

Thanks

Venkat

Muniyappan
Active Contributor
0 Kudos

you need to use sortbykey for that.

for item change the context when values changes(test1,test2)

for all values you have to follow the sortbykey(Date,country,data1data2,data3,data4)

can you please share your idoc segment structure?

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

If your case is some thing like test1,test2 may or may not come at least once then export the IDoc to local system and change the occurrence of IDoc from 1..1 to 0..1 and import back to PI system.

Key --> remove context --> Sort --> split by value change -->> collapse context-->splibyvalue--IDpc1

Key --> remove context --> Sort --> split by value change -->> collapse context-->splibyvalue--IDpc2

Key --> remove context -->sortbykey()-->give this as first input to the below formatbyexample

data4-->removecontext-->/

key -->remove context-->sort-->splibyvaluechange---->formatbyexample-->udf1(use All values of context)-->splitbyValue(eachValue) -->map this to graphical in IDoc1,IDoc2

udf1:

String Temp = "";

for(int i-0;i<Input.length;i++){Temp = Temp +Input[i] +";";}

Output.addValue(Temp);

---------------------------------------

graphicalvariable in IDOC1-->udf2-->respective field  (as per your logic)

graphicalvariable in IDOC2-->udf2-->respective field (as per your logic)

udf2:Split based on delimiter 

Regards

Venkat