‎2010 Jan 22 6:44 AM
Hello All,
Like cl_abap_datfm=>conv_date_ext_to_int and cl_abap_datfm=>conv_date_int_to_ext which changes the date format ,is there any class/method which changes the number format......I mean decimal and thousand separator format. I have to do that based on the User settings which I am getting from USR01 table. But not getting any class/method where I have to submit the number along with the format to get the format as per user settings.
Thanks in Advance.
regards.
Sarbajit.
‎2010 Jan 22 6:50 AM
hi i dont know regarding the class or method but you can try the following if it helps in your code
use the set statement.
SET DECIMAL '/ /,/'
Specifies the following number format: 1 999 987,98
SET DECIMAL '///'
Specifies the following number format (Loader default): 1999987.98
‎2010 Jan 22 6:57 AM
Hi
Try using SET Decimal,FORMAT statment in the program.
Regards
Gaurav
‎2010 Jan 22 8:57 AM
Hi Sarbajit,
No need for FM. Try like below using 'Write To' statement,
Declare a variable of type P.
Move ur number to that variable.
Then Write that variable to variable of type Char.
Now Char variable will contain value according to the User Decimal Settings.
PARAMETERS: num TYPE i DEFAULT 9999. " Enter ur number
DATA: qty TYPE p DECIMALS 3, " Variable of Packed type
ch(13) TYPE c. " Character variable
qty = num.
WRITE qty TO ch. " According to Decimal format in SU01, value is written
WRITE ch.
Thanks,
‎2010 Mar 09 6:22 AM