cancel
Showing results for 
Search instead for 
Did you mean: 

Format of Number

adnanmaqbool
Contributor
0 Kudos

Dear All

I have a situation where I have to format the amount number during message mapping. Requirement is as follows.

Transaction Amount: Must be of 13 digits Right aligned, padded with 0s. e.g. "500.00" will sent as u201C0000000050000"

Is there any possibility to use FormatNumber function available in Message Formating for this pupose or how can I write a code to create my own function.

Accepted Solutions (1)

Accepted Solutions (1)

abhay_rajhans2
Contributor
0 Kudos

Hi Adnan,

Format number can satisfy your requirement.

Check below link.

http://wiki.sdn.sap.com/wiki/display/HOME/MessageMappingFormat+Number

Answers (1)

Answers (1)

udo_martens
Active Contributor
0 Kudos

Hi,

put as target format of formatNum function 13 zeros.

Regards,

Udo

Former Member
0 Kudos

Hi Udo,

your solution will result in:

0000000000500

So this will work if you have not more than 2 decimal places. In this case you could first multiply with 100 and then use Format Number.

Regards

Patrick

udo_martens
Active Contributor
0 Kudos

Hi Patrick,

this is right and will work if the source format is defined as you assume , but he did not speak about the source format.

Regards,

Udo