01-02-2015 12:30 PM
Hi,
Any Function module to convert from String to Packed decimal?
String value : "15-.00"
01-02-2015 12:35 PM
Hi,
you could check for some conversion FM, e.g. BAPI_CURRENCY_CONV_TO_EXTERNAL / INTERNAL, or PP_CATT_CONVERT_DECIMAL_POINT.
BR,
EH
01-02-2015 12:45 PM
Hi Dhinesh,
Here in the string Negative sign comes inbetween the value looks like the below.
15-.00
Ex:
data Str_value type string value "15-.00".
data dec_value type p decimals 2.
"Check whether negative sign in the variable
if str_value CA '-'.
"Replace Negative sign
REPLACE ALL OCCURRENCES OF '-' IN str_value WITH ``.
"Add the sign value into the first place
concatenate '-' str_value into str_value.
endif.
Output
-15.00
"Remove Empty space
condense str_value.
"Convert the value
dec_value = str_value.
Regards
Rajkumar.