04-17-2021 6:38 PM
in this code output will be
i want
DATA v_str TYPESTRINGVALUE'123,456,789,123.456'.
DATA v_flt TYPE F.WRITE:/'String :', v_str."With Commas
REPLACEALLOCCURRENCESOF','IN v_str WITH''.
WRITE:/'String :', v_str."Without Commas
CATCHSYSTEM-EXCEPTIONS ARITHMETIC_ERRORS =1
CONVERSION_ERRORS =2.
MOVE v_str TO v_flt.ENDCATCH.
WRITE:/'Float :', v_flt."Float value
04-17-2021 8:49 PM
Have you checked the user settings; The output format is based on what the defaults is set to
04-18-2021 8:32 AM
04-18-2021 7:52 AM
Think to split the problem in smaller units.
So your first question is to remove the blanks in STRING so that to get 123456789123.456
04-18-2021 1:21 PM
Hello Symbat,
Here's a page which explains several ways of converting strings to numbers. For your question, Method 1 in the second block seems to be fitting very well:
https://sap4tech.net/convert-string-number-string-abap/amp/#method-1-with-abap-coding-the-statement
Best Regards
Marco