物料只允许字母和数字-正则表达式做校验 DATA: lv_matnr2 TYPE string, matcher TYPE REF TO cl_abap_matcher, match TYPE c LENGTH 1. matcher = cl_abap_matcher=>create( pattern = '[A-Za-z0-9]+$' text = lv_matnr2 ). match = matcher->match( ). IF match = 'X'. "正确 else "有特殊符号 ENDIF. 参考链接