report ztest131 message-id zmsg line-size 136 line-count 33 no standard page heading. DATA curr TYPE c. curr = '123,456,789.00 '. while sy-subrc = 0. replace ',' with '' into curr. endwhile. condense curr no-gaps.
"去掉后置0
data p_number(20) value '56.500'.
CALL FUNCTION 'STRING_REVERSE' EXPORTING string = P_number lang = '1' IMPORTING RSTRING = P_number EXCEPTIONS TOO_SMALL = 1 OTHERS = 2 . IF sy-subrc <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF.
shift P_number left deleting leading '0'.
CALL FUNCTION 'STRING_REVERSE' EXPORTING string = P_number lang = '1' IMPORTING RSTRING = P_number EXCEPTIONS TOO_SMALL = 1 OTHERS = 2 . IF sy-subrc <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF.