Skip to Content
0
Feb 08, 2020 at 04:24 AM

If/Else statement within HCI mapping

591 Views Last edit Feb 08, 2020 at 04:36 AM 4 rev

Hi All,

I'm attempting to create a simple if/else statement script within a mapping process.The script looks into the first field and makes a decision where the second field (source data) should get mapped out of the two outgoing target fields . Please let me know why the script isn't working . Thank you.

import com.sap.it.api.mapping.*;
import java.lang.*;


def void custFunc2(String[] N,String[] GL, Output PC , Output CC , MappingContext context) 

{

if(N[] == '1' )

{  GL[] = CC ;
    
}

else if (N [] == '2' )

{  GL[] = CC;
 
}
 
  else
  
  { GL[] = PC;
    
  } 

}