data:l_p(16) type p decimals 3.
CALL FUNCTION ‘UNITS_STRING_CONVERT’
EXPORTING
units_string = ‘123,456.789’
dcpfm = ‘X’ ”这个是根据su01里你的数字格式来设置,sap标准的格式有三种:空,X,Y
* MLLN = ‘M’
* TSND = ‘T’
IMPORTING
UNITS = l_p ” UNITS 时参照你输入的l_p来定义的
EXCEPTIONS
INVALID_TYPE = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
write:/ ‘l_p1’.
else.
write:/ ‘l_p2’,l_p.
ENDIF.
这个格式是将带,的字符去掉,再存入一个p类型变量中