on 03-06-2012 7:11 PM
Dear Experts-
I am working on a File to ABAP proxy design. In source have 2 fields that has to be compared and send a specified value to same field in target. Please find the logic to be implemented below:
Source : Text File
Target : ABAP proxy
When Source A=ISO and Source B >=0 then Target A=261
When Source A=ISO and Source B <0 then Target A=261
When Source A=ISO or ISW and Source B >=0 then Target A=100
When Source A=ISO or ISW and Source B <0 then Target A=99
I am trying to do this design using if then else but can get working for 2 fields but unable to check 4 conditions. Please provide a solutions either through the mapping or UDF. I have a very tight time line of 24 hours. Please do help me to get this fixed.
Thanks in advance
Hi,
It can be achieved with standard PI functions equally well. Along with the IF function, you also have AND and OR functions that let you connect several conditions. You already know the requirement well, since you described it here. So now it is pretty straightforward to build the mapping logic with a combination of IFs, ANDs and ORs, just like you described it here.
Hope this helps,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You basically need if logic check. This is simple UDF passing the two input values.
Execution type single values
public int returnValues(String a. int b, Container container) throws StreamTransformationException{
int code = 0;
if (a.equals("ISO") && (b >= 0 || b < 0) ){
code = 261;
}else if (a.equals("ISO") || a.equals("ISW")){
if(b>= 0){
code = 100;
} else{
code = 99;
}
}
return code;
}
Mapping
Source field a,b values --> udf --> target field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.