cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Requirement

Former Member
0 Kudos

Hi Experts,

I have an scenerio where sender is sending the value for Qty(quantity) field as 000056.765kg and Receiver is expecting the value to come in 56.765kg.

How to do this in mapping.

Regards,

Ravi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ravi,

Please check my logic below.Consider Name Field as Qty here.

Multiple Oty such as 00056.75 * 1= 56.75 and concat it with KG you will  get the output.

Regards,

Abhi

Former Member
0 Kudos

Thanks Abhinav for sharing this information.

Answers (4)

Answers (4)

0 Kudos

Hi,

You have a Standard function available in the Message mapping.

Its FormatNumber  use it with the value ##.##

that will give you the necessary output.

mvh

Kishore

Former Member
0 Kudos

Hi Ravi,

You can write a simple udf to remove the leading zeroes in this case:

int c = 0;

                    char[] arr = qty.toCharArray();

                    for(int i = 0; i < arr.length; i++) {

                              if(arr[i] != '0') {

                                        c = i;

                                        break;

                              }

                    }

                    qty= qty.substring(c);

return qty;

Hope this helps!!!

Regards,

Anurag Mahendru

Former Member
0 Kudos

Hi Anurag,

We can achieve this cenerio without udf.Please check my logic below.Consider Name Field as Qty here.

Multiple Oty such as 00056.75 * 1= 56.75 and concat it with KG you will  get the output.

Regards,

Abhi

Former Member
0 Kudos

Hello,

Chk this:

http://scn.sap.com/thread/1658074

Thanks

Amit Srivastava

gagandeep_batra
Active Contributor
0 Kudos

I think you can use format function for that

Regards

Gagan