on 05-30-2014 2:38 PM
Hi,
Here is my mapping attached screent shot. Everything is working except one issue for first if condition
If TDLine(count)>25 and if TDID =F01 then first id on target should be F01 and remaining id should be F01-cont
For each TDLine(count)>25 ,it is generating multipes tdids but each tdid has value of F01-cont
If there are 51 TDlines with one TDID =F01
on Target
Notes
F01
Notes
F01-cont
Notes
F01-cont
Used below udf to populate notes
nt count = Integer.parseInt(segcount[0]);
for (int i = 0; i < count; i = i+25)
{
result.addValue("");
}
Regards
Hi Mahesh,
Can you elaborate your mapping logic? it seems to be incomplete.
regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Multiple E1EDKT1 segments with one TDID for segment
and under one E1EDKT1 segment multiple TDLines E1EDKT2in source
In target side , need to generate multiple Note segments with Id and Text
for each 25 TDlines (for one E1EDKT1 ) which is working fine.
for the id value on target side
if source has E1EDKT1>TDID value of F01 and multiple TDLines E1EDKT2(count) more than 25
first id should be F01 and second id should be F01-cont and third id should be F01-cont
if the id has other than F01 it is going to else condition which is working fine
In the attached test data with one TDI F01 and 131 TDlines .Generatted 6 notes with id and text on target side first id is F01 and second id is F01-cont . first id not correct it should be F01 Not sure how to add the logic for first if condition to get only first ID value be F01 and remaining ID values F01-cont
Hope I am clear
Hi Mahesh,
Please correct me it the below logic is wrong
for TDID = F01, check no of TDLINE
If TDLINE count > 25 then first is F01 and rest all F01-cont
If TDLINE <25 then target is F01
I would suggest to remove graphical function if and replace with UDF. In UDF for the first check first value is F01 and rest all are F01-cont. So please try the java code for the logic and let me know if you need any help.
regards,
Harish
Hi Mahesh,
we can take the fixed value mapping as input to UDF. try the below logic
for(int i=0;i<TDID.length;i++)
{
if(TDID[i].equals("F01"))
{
if (TDLINE.length <5)
{
for(int j=0;j<TDLINE.length;j++)
{
result.addValue(TDID[i]);
}
}
else
{
for(int j=0;j<TDLINE.length;j++)
{
if(j==0)
result.addValue(TDID[i]);
else
result.addValue(TDID[i]+"-Cont");
}
}
else
//code the fix mapping logic
}
regards,
Harish
Thanks Harish I tested with F01 and it worked .For else condition other than F01 getting issue .something is not correct in coding after last else statment.
String vnoteidtext ;
for(int i=0;i<TDID.length;i++)
{
vnoteidtext = valmap[i] ;
if(TDID[i].equals("F01"))
{
if (TDLINE.length <25)
{
for(int j=0;j<TDLINE.length;j++)
{
result.addValue(TDID[i]);
}
}
else
{
for(int j=0;j<TDLINE.length;j++)
{
if(j==0)
result.addValue(TDID[i]);
else
result.addValue(TDID[i]+"-Cont");
}
}
else
{
if(!TDID[i].equals("F01"))
result.addValue( vnoteidtext]);
}
}
}
Hi Mahesh,
for else you want to display only one constant field or you have any conversion logic? please change the code as follow
String vnoteidtext ;
for(int i=0;i<TDID.length;i++)
{
vnoteidtext = valmap[i] ;
if(TDID[i].equals("F01"))
{
if (TDLINE.length <25)
{
for(int j=0;j<TDLINE.length;j++)
{
result.addValue(TDID[i]);
}
}
else
{
for(int j=0;j<TDLINE.length;j++)
{
if(j==0)
result.addValue(TDID[i]);
else
result.addValue(TDID[i]+"-Cont");
}
}
else
{
for(int j=0;j<TDLINE.length;j++)
{
result.addValue( vnoteidtext);
}
}
}
Not sure what the issue . Everything i copied samebbut still I am getting the compile error
|
String vnoteidtext ;
for(int i=0;i<TDID.length;i++)
{
vnoteidtext = valmap[i] ;
if(TDID[i].equals("F01"))
{
if (TDLINE.length <25)
{
for(int j=0;j<TDLINE.length;j++)
{
result.addValue(TDID[i]);
}
}
else
{
for(int j=0;j<TDLINE.length;j++)
{
if(j==0)
result.addValue(TDID[i]);
else
result.addValue(TDID[i]+"-Cont");
}
}
else
{
for(int j=0;j<TDLINE.length;j++)
{
result.addValue( vnoteidtext);
}
}
}
}
Hi Mahesh,
Some problem with { position please check the below
String vnoteidtext ;
for(int i=0;i<TDID.length;i++)
{
vnoteidtext = valmap[i] ;
if(TDID[i].equals("F01"))
{
if (TDLINE.length <25)
{
for(int j=0;j<TDLINE.length;j++)
{
result.addValue(TDID[i]);
}
}
else
{
for(int j=0;j<TDLINE.length;j++)
{
if(j==0)
result.addValue(TDID[i]);
else
result.addValue(TDID[i]+"-Cont");
}
}
}
else
{
for(int j=0;j<TDLINE.length;j++)
{
result.addValue( vnoteidtext);
}
}
}
Thanks Harish. I testED with data first EDKT1 >TDID =F01 and EDKT2 with 30 lines of TDlines and second EDKT1 >TDID =ST and EDKT2 with 10 lines of TDlines
So first ID it created Fo1 and second ID created with F01-continue which is correct.
but for third TDID also it created with same F01-cont instead of third input for ST which is in the fixed values .This should come from last else statement
Thanks
Please change the logic as below
String vnoteidtext ;
double number;
int no;
for(int i=0;i<TDID.length;i++)
{
vnoteidtext = valmap[i] ;
if(TDID[i].equals("F01"))
{
number = TDLINE.length;
number = Math.ceil(number/25);
no = (int) number;
if (TDLINE.length <25)
{
for(int j=0;j<no;j++)
{
result.addValue(TDID[i]);
}
}
else
{
for(int j=0;j<no;j++)
{
if(j==0)
result.addValue(TDID[i]);
else
result.addValue(TDID[i]+"-Cont");
}
}
}
else
{
for(int j=0;j<no;j++)
{
result.addValue( vnoteidtext);
}
}
}
Hi Mahesh,
i misplaced the variable, now it should work
for(int i=0;i<TDID.length;i++)
{
vnoteidtext = valmap[i] ;
number = TDLINE.length;
number = Math.ceil(number/25);
no = (int) number;
if(TDID[i].equals("F01"))
{
if (TDLINE.length <25)
{
for(int j=0;j<no;j++)
{
result.addValue(TDID[i]);
}
}
else
{
for(int j=0;j<no;j++)
{
if(j==0)
result.addValue(TDID[i]);
else
result.addValue(TDID[i]+"-Cont");
}
}
}
else
{
for(int j=0;j<no;j++)
{
result.addValue( vnoteidtext);
}
}
}
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.