Here’s the Abap sample code.
REPORT Z_STRING_NUMERIC.
Parameter: p_string(100).
data: d_numeric like CAWAO_S_FIELDS-NUM_VAL.
CALL FUNCTION ‘IF_CA_MAKE_STRING_NUMERICAL’
EXPORTING
INPUT_STRING = p_string
IMPORTING
VALUE = d_numeric
EXCEPTIONS
NOT_NUMERICAL = 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.
Write:/ d_numeric.
When you execute the program, you will see the numeric display like below.
Post a Comment