SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Obsolete Language Elements → Obsolete Program Flow → Obsolete Relational Expressions →rel_exp - IN, Short Form
Obsolete Syntax
... seltab ...
Effect
This relational expression has the same effect as the comparison expression
To use this short form, operand must be the data object for which the selection table seltab was declared using
SELECT-OPTIONS seltab FOR operand.
with the data object operand being specified statically. This short form is not possible for selection tables created other than with the statement SELECT-OPTIONS.
Note
Using this short form makes a program more difficult to understand. In particular, using this short form in processing blocks not in the immediate vicinity of the selection table's declaration can make the program confusing.
Example
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-sign = 'I'.
s_number-option = 'EQ'.
s_number-low = 9.
APPEND s_number TO s_number.
s_number-sign = 'I'.
s_number-option = 'BT'.
s_number-low = 3.
s_number-high = 7.
APPEND s_number TO s_number.
s_number-sign = 'E'.
s_number-option = 'EQ'.
s_number-low = 6.
APPEND s_number TO s_number.
s_number-sign = 'E'.
s_number-option = 'BT'.
s_number-low = 1.
s_number-high = 4.
APPEND s_number TO s_number.
DO 10 TIMES.
number = sy-index.
IF s_number.
cl_demo_output=>write_data( sy-index ).
ENDIF.
ENDDO.
cl_demo_output=>display( ).