sap 提取字符串中汉字

DATA: alpha_num(120) TYPE c.

alpha_num = ' abcdefghijklopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,./;''[]\-=`<>?:"{}|_+~!@#$%^&*()'.

IF input CA alpha_num.
output = '不仅仅全是汉字'.
ELSE.
output = '全是汉字'.
ENDIF.

IF NOT input CO alpha_num.
output = '含有汉字'.
ELSE.
output = '不含有任何汉字'.
ENDIF.


提取汉字
data len type i.
data n type i.
len = strlen( input ).

do len times.
n = sy-index - 1.
if not alpha_num cs input+n(1).
concatenate output input+n(1) into output.
endif.

enddo.

 

posted @ 2013-02-03 17:30  hanmos  阅读(759)  评论(0编辑  收藏  举报