rel_exp - IN, Short Form
... selcrit ...
This relational expression has the same effect as the comparison expression
operand is the data object for which the
selcrit was declared using
The short form is only possible for selections tables declared using the statement
SELECT-OPTIONS and with a statically specified data object. More specifically, the short form is not possible for
- Using this short form makes a program more difficult to understand. In particular, using this short form in processing blocks not immediately adjacent to the declaration of the selection table declaration can make the program confusing.
- More specifically, this short form should not be confused with a predicative method call. A call of this type is false if its result is initial, whereas the short form shown here is always true for an initial selection table.
Fills a selection table
s_number and evaluates it using the short form
number IN s_number. The output consists of the numbers 5, 7, and 9.
DATA number TYPE i. SELECT-OPTIONS s_number FOR number NO-DISPLAY. s_number = VALUE #( ( sign = 'I' option = 'EQ' low = 9 ) ( sign = 'I' option = 'BT' low = 3 high = 7 ) ( sign = 'E' option = 'EQ' low = 6 ) ( sign = 'E' option = 'BT' low = 1 high = 4 ) ). DO 10 TIMES. number = sy-index. IF s_number. cl_demo_output=>write_data( sy-index ). ENDIF. ENDDO. cl_demo_output=>display( ).