REPORT Y_CTF_2.
data: l_s type string.
data: l_rule type string.
l_s = '双零铝箔_进口料_A1235_无菌包材用铝箔_630×1504_800_300'.
PERFORM GET_RULE_FROM_STRING using l_s changing l_rule.
write l_rule.
form GET_RULE_FROM_STRING USING value(s) CHANGING rule.
types ts type table of string.
data li_ts type ts.
data l_s type string.
SPLIT s at '_' into table li_ts.
loop at li_ts into l_s.
find '×' in l_s.
if sy-subrc = 0.
rule = l_s.
exit.
endif.
endloop.
ENDFORM.