on 07-16-2014 12:12 PM
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
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
Date | country | data1 | data2 | data3 | data4 | key |
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 |
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.