Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Conversion of Number to decimal notation

Former Member
0 Kudos
1,608

Hi

I have a requirement wherein i have a number say 123456789 and want to convert to the decimal notation... that is 123.456.789,000 or 123,456,789.00.... This converted number i then used as per the user defult setting in SU3.....

I have tried few of the FM like IF_CA_MAKE_STRING_NUMERICAL, SD_CONVERT_CURRENCY_FORMAT, BAPI_CURRENCY_CONV_TO_EXTERNAL... all of them gives me the desired output when executed in se37... but when i use them in program it only adds the decimal point. Also if the mentioned FM are debugged in se37, before the control leaves the fm we do not get the desired value...

I need the number in the desired format as after that i will have to use TRANSLATE command.

could some one pls suggest...

Thanks and best regards,

Monish

1 ACCEPTED SOLUTION

former_member585060
Active Contributor
0 Kudos
1,390

Declare a text field of lenght 18, the use WRITE statement.

DATA : v_num TYPE p DECIMALS 3,
             v_text  TYPE c LENGTH 18.

v_num = '12345678'.

WRITE : v_num TO v_text.

Thanks & Regards

Bala Krishna

2 REPLIES 2

former_member585060
Active Contributor
0 Kudos
1,391

Declare a text field of lenght 18, the use WRITE statement.

DATA : v_num TYPE p DECIMALS 3,
             v_text  TYPE c LENGTH 18.

v_num = '12345678'.

WRITE : v_num TO v_text.

Thanks & Regards

Bala Krishna

kesavadas_thekkillath
Active Contributor
0 Kudos
1,390

Thousand separators are displayed in the output only. Decimals separators are visible in the program debugging mode itself. Check moving it to character variable.

What is your requirement ?