sql_cond - IN seltab
... col [NOT] IN seltab ...
This expression is true if the value of the column
col is (not) in the result set described in the rows of the
seltab. Any internal table with a row type that corresponds to that of a selection table can be specified as the selection table
seltab. This includes, in particular,
The selection table is evaluated in the same way as in
logical expressions apart from the fact that
in comparisons with the operators
WHERE condition is case-sensitive, whereas in other logical expressions it
is not. The wildcard characters "*" and "+" of the selection options "CP" and "NP" are converted to
the OpenSQL wildcard characters "%" and "", whereby the escape character "#" is also handled correctly. If "%" and "" are contained in the template, an OpenSQL escape character is generated.
- If the selection table contains invalid values, an exception that cannot be handled is raised.
- If the selection table is initial, the expression is always true. If no conditions are specified apart from the expression above, all rows of the database table are selected if the selection table is initial.
- The conditions specified in the selection table are passed by the database interface to the database as SQL statement input values. The maximum number of input values depends on the database system and is usually between 2000 and 10000. If the maximum number is exceeded an exception of the class CX_SY_OPEN_SQL_DB is raised.
A selection table is filled as follows (the order of the rows is not important):
I EQ 01104711
I BT 10000000 19999999
I GE 90000000
E EQ 10000911
E BT 10000810 10000815
E CP 1%2##3#+4++5*
WHERE condition is generated from this:
ID BETWEEN '10000000' AND '19999999' OR
ID >= '90000000' ) AND
ID <> '10000911' AND
ID NOT BETWEEN '10000810' AND '10000815' AND
ID NOT LIKE '1#%2##3+4__5%' ESCAPE '#' ...
DATA spfli_wa TYPE spfli. SELECT-OPTIONS: s_carrid FOR spfli_wa-carrid NO INTERVALS NO-EXTENSION, s_connid FOR spfli_wa-connid NO INTERVALS NO-EXTENSION. SELECT SINGLE * FROM spfli INTO spfli_wa WHERE carrid IN s_carrid AND connid IN s_connid.