on 04-30-2015 6:59 AM
Hi Everyone,
I am working on Idoc to file scenario, and need to create line item on file based on below complex requirement.
The structure of IDOC is as follows:
Now the requirement is I need to check If segment Z1P1208 exists, if yes then need to check if E1P0001-->PLANS=E1P1005-->OBJID,
if true then I need to create (number of Z1P1208)*(number of E1P0001) records so in this case 2(Z1P1208)*3(E1P0001) i.e 6 records/line items in output file.
Please help me to achieve this.
Regards,
Sachi
Hi Dubey,
Is the number of E1P1005 always the same as E1P0001? If yes, you have to create a UDF and pass the 3 parameters Z1P1208, PLANS (context of E1PITYP), and OBJID ( (context of E1PITYP). And create 2 loops and create code something like this.
for (int x = 0; X< Z1P1208.length; x++){
for (int y = 0; y <PLANS.length; y++){
if ( PLANS[y].equals(OBJID[y])){
// add values you want to output using result.add().
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am trying this:
In getRecord the code written is:
String a = "false";
for( int i=0; i<var1.length;i++){
if(var1[i].equals("true")){
for(int j=0;j<var2.length;j++){
if(var2[j].equals("true")){
a = "true";
}
}
}
}
what I am trying is that these loops should return me number of true(here 6) so that createif will creat 6 records if it gets true from UDF.
but currently this code is returning me null. why?
Please suggest what is wrong.
Regards,
Sachi
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.