判断某个字段里是否含有非数字字符

DATA:BB TYPE I.

*PARAMETERS P_CHAR(20) TYPE C.

CATCH SYSTEM-EXCEPTIONS CONVERSION_ERRORS = 1.

  MOVE as_str TO BB.

ENDCATCH.

*WRITE :/ P_CHAR , BB.

IF SY-SUBRC = 1 .

  * WRITE '这不是个数字'.

  as_isnumber = ''.

ELSE.

  * WRITE '这是个数字的字符'.

  as_isnumber = 'X'.

ENDIF.

你可能感兴趣的:(判断某个字段里是否含有非数字字符)