SAP-RANGES
SIGN: I 包含;E 排除
OPTION:EQ、NE、GT、LE、LT、CP、NP、BT、NB
DATA: l_bukrs TYPE RANGE OF bukrs.
LOOP AT lt_t001.
APPEND VALUE #(
sign = 'I'
option = 'EQ'
low = lt_t001-bukrs
) TO l_bukrs.
ENDLOOP.
----------------------------------
DATA: l_tab TYPE RANGE OF char10 WITH HEADER LINE.
l_tab-sign = 'I'.
l_tab-option = 'CP'.
l_tab-low = '4*'.
APPEND l_tab.
IF '401' in l_tab.
WRITE:/ 'true'.
ELSE.
WRITE:/ 'false'.
ENDIF.
l_tab-sign = 'I'.
l_tab-option = 'BT'.
l_tab-low = '1'.
l_tab-high = '5'.
APPEND l_tab.
--------------------------------
RANGES: r_pclx FOR z*-aaa.
loop....
r_pclx-sign = 'I'.
r_pclx-option = 'EQ'.
r_pclx-low = a-b.
APPEND r_pclx.
CLEAR: r_pclx.
endloop.