REPORT ZAU_DFORMAT.
data: lv_price TYPE netpr,
lv_string(10) TYPE c,
l_usr01 TYPE USR01,
lv_calc TYPE p DECIMALS 2.
lv_price = '1000000.12'.
WRITE lv_price to lv_string.
*lv_calc = lv_string.
CALL FUNCTION 'CETA_USR01_READ'
EXPORTING
BNAME = SY-UNAME
IMPORTING
USR01_EXP = L_USR01
EXCEPTIONS
NO_ENTRY = 01.
CASE L_USR01-DCPFM.
" , as thousand separator
WHEN 'X'.
REPLACE ALL OCCURRENCES OF ',' IN lv_string WITH SPACE.
CONDENSE lv_string NO-GAPS.
" space as thousand separator
WHEN 'Y'.
CONDENSE lv_string NO-GAPS.
" . as thousand separator
WHEN OTHERS.
REPLACE ALL OCCURRENCES OF '.' IN lv_string WITH SPACE.
CONDENSE lv_string NO-GAPS.
ENDCASE.
" Make . as decimal separator
REPLACE ALL OCCURRENCES OF ',' IN lv_string WITH '.'.
lv_calc = lv_string.
WRITE: lv_calc.
Serkan AKKAVAK
Bilgisayar Mühendisi
serkurumsal@yandex.com
Social Plugin