cancel
Showing results for 
Search instead for 
Did you mean: 

MAPPING HELP NEEDED.

Former Member
0 Kudos

Dear All

We are getting a field value as decimal some times and without decimal.I need to concatenate with M if it is decimal else I need to concatenate with CM

in sap pi.Kindly help with the mapping logic.

Regards

Nagur

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

I would write a UDF that takes the input as String s


String decimalsep ="." ;

if(s.contains(decimalsep)){

      s= s+"M";
}else{

     s=s+"CM";

}

return s;

Former Member
0 Kudos

Hi Bhavesh

Thanks for the quick reply.

If field is empty i need to populate the empty value.Kindly help me in order to modify the logic.

Regards

Nagur

manoj_khavatkopp
Active Contributor
0 Kudos

Use Map with Default.

bhavesh_kantilal
Active Contributor
0 Kudos

This is basic if then else coding. For your own success I do hope you pick up some java coding skills to sustain in PI.

String decimalsep ="." ;
if(!(s.equals(""))){

    if(s.contains(decimalsep)){ 

      s= s+"M"; 
   }else{ 
     s=s+"CM"; 
   }
}

   return s; 

Former Member
0 Kudos

Manoj

At that time i dont need cm or m in target.

Regards

Nagur

Former Member
0 Kudos

Thanks Bhavesh.

Regards

Nagur

Answers (0)