cancel
Showing results for 
Search instead for 
Did you mean: 

Design Logic Issue

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member184681
Active Contributor
0 Kudos

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

baskar_gopalakrishnan2
Active Contributor
0 Kudos

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