根据当前用户的金额显示方式,将带有分隔符的金额(字符型)转换为P类型的数值。
DATA: lv_clabs TYPE p DECIMALS 3,
lv_dcpfm LIKE usr01-dcpfm.
SELECT SINGLE dcpfm
INTO lv_dcpfm
FROM usr01
WHERE bname = sy-uname.
CALL FUNCTION 'UNITS_STRING_CONVERT'
EXPORTING
units_string = '123,456.789' "-123,456.789 会报错
dcpfm = lv_dcpfm
IMPORTING
units = lv_clabs
EXCEPTIONS
invalid_type = 1
OTHERS = 2.