on 2016 Sep 20 4:25 PM
Dear experts,
Interface : IDOC --> JDA
before sending to JDA, there is another mapping to check duplicates in the same context.
As per screen,an item should check the duplicates in the context of the articles and trigger out the same but output comes in reverse order.
based on this logic, output is coming in reverse order, so inserting wrong values in JDBC table. please advise me code.
ArrayList aList = new ArrayList();
int j = 1;
for(int n=0; n<var1.length; n++)
j = n;
aList.add(var1[j]);
result.addValue(var2[j]);
for(int i=j-1; i>-1; i--){
if(aList.contains(var1[i])){
continue;
}
else{
aList.add(var1[i]);
result.addValue(var2[i]);
}
}
Request clarification before answering.
Hi Deva,
As per the screenshot if you want to remove the duplicate values from the field 'ITEM' then you can use the below UDF:
UDF type: Context
input: ITEM as a string
----------------------------------
ArrayList al = new Arraylist();
for(int i =0;i<ITEM.length();i++){
if(!al.contains(ITEM[i])){
al.add(ITEM[i]);
}
}
for(int j=0; j<al.size();j++){
result.addValue(al.get(j).toString());
}
-----------------------------------------------
Hope this will help you to remove the duplicates from the context.
Regards,
Suman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
31 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.