‎2009 Jan 12 11:03 AM
Hi All,
I need to convert the amount value in comma to dot say 1000,00 to 1000.00.Any function module is there to convert it.After converting it i need to pass this value as exporting parameter to a function module having data type as character(lenght 13).
Thnks
Deb
‎2009 Jan 12 11:19 AM
Hello Deb,
Try the code below:
DATA:
V_AMT TYPE WRBTR VALUE '5000,00',
V_INT1 TYPE NUMC10,
V_DEC1 TYPE NUMC2,
V_DATA TYPE CHAR13.
V_INT1 = TRUNC( V_AMT ).
V_DEC1 = FRAC( V_AMT ).
CONCATENATE V_INT1 '.' V_DEC1 INTO V_DATA.
WRITE: V_DATA.
Hope this helps.
BR,
Suhas
‎2009 Jan 12 11:07 AM
Goto System->User Profile->Own data
Defaults tab..Maintain the desired one in field Decimal Notation
‎2009 Jan 12 11:16 AM
Hi,
Check the table USR01 for user defaults (DCPFM), based on the value you change the decimal notation.
Hope it helps!!
let me know for any further help!!
Regards,
Pavan
‎2009 Jan 12 11:19 AM
Hello Deb,
Try the code below:
DATA:
V_AMT TYPE WRBTR VALUE '5000,00',
V_INT1 TYPE NUMC10,
V_DEC1 TYPE NUMC2,
V_DATA TYPE CHAR13.
V_INT1 = TRUNC( V_AMT ).
V_DEC1 = FRAC( V_AMT ).
CONCATENATE V_INT1 '.' V_DEC1 INTO V_DATA.
WRITE: V_DATA.
Hope this helps.
BR,
Suhas
‎2009 Jan 12 11:24 AM
Hello Suhas,
I guess, the decimal notation is not constant value (.), it will vary based on the user defaults...
so it should dynamically change based on the user defaults.
Regards,
Pavan
‎2009 Jan 12 11:32 AM
Hello Vishnu,
That is what i have done. FRAC returns me the "Value of the decimal places of the argument ". It does not depend on the decimal separator.
BR,
Suhas
‎2009 Jan 12 11:21 AM
Hi,
Either maintain it in the User profile if you always want to run this way.
Maintain whichever decimal notation is preferred. This has tobe done for the user who will be executing the report..
Or you wish to change onlyin your report then you may use TRANSLATE wa_text USING ',..,' at the time of output..
‎2009 Jan 12 11:31 AM
Hi,
Use
replace all occurrences of ',' in <your field name> with '.'.
‎2009 Jan 12 11:37 AM
Hi Debabrata,
Did you try with REPLACE statement ?
Check this code snippet:
DATA: a TYPE string VALUE '5000,00'.
REPLACE ALL OCCURRENCES OF ',' IN:
a WITH '.' .
WRITE a.
‎2009 Jan 21 11:16 AM