‎2016 Apr 01 4:06 AM
Hi all,
When we use FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' to upload Excel file directly, the value may have more than one
format:
eg. 1,234,567.88 or 1 234 567,88
Is there any function can convert value to internal format(1234567.88) which by user profile setting?
if not, any way to recognize the decimal notation is comma(,) or dot(.)?
Tks!
‎2016 Apr 01 6:18 AM
Try this
DATA: lv_value TYPE string,
lv_dcpfm TYPE usr01-dcpfm.
lv_value = |1,234,567.89|.
SELECT SINGLE dcpfm
INTO lv_dcpfm
FROM usr01
WHERE bname = sy-uname.
IF lv_dcpfm EQ 'X'.
REPLACE ALL OCCURRENCES OF ',' IN lv_value WITH ''.
ELSEIF lv_dcpfm EQ ''.
REPLACE ALL OCCURRENCES OF '.' IN lv_value WITH ''.
TRANSLATE lv_value USING ',.'.
ELSEIF lv_dcpfm EQ 'Y'.
TRANSLATE lv_value USING ',.'.
ENDIF.