SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Program Flow Logic → Expressions and Functions for Conditions → log_exp - Logical Expressions → rel_exp - Relational Expressions → rel_exp - Relational Operators → rel_exp - Relational Operators for All Data Types →rel_exp - Table-Like Relational Operator IN
Syntax
... operand [NOT] IN seltab ...
Effect
In a comparison expression with relational operator IN, the conditions of a selection table or a table with this layout are checked, that is whether an operand operand meets the conditions of the rows in the selection table or, with addition NOT, does not meet them. The table-like comparison expression is equivalent to a join using binary or ternary comparison expressions whose number is determined by the number of rows in the internal table.
As a selection table seltab, any internal table can be specified whose row type matches that of a selection table, or a functional method with the corresponding type of return value. This includes, in particular, ranges tables. The selection table can be of any table category. For the layout of a selection table, refer to section SELECT-OPTIONS. The evaluation of a selection table requires the table to contain the valid values specified in that section in the columns sign and option. If the selection table contains invalid values, an exception that cannot be handled is raised. If the selection table is initial, the comparison expression is always true.
Each row in a non-initial selection table is included in the join using one of the following comparison expressions. Depending on the operator in the column option, this involves a comparison between two operands using a binary relational operator or the delimitation of an interval using the ternary operator BETWEEN.
operand is a general expression position and the usual comparison rules apply to operand and the columns low and high of the selection table. The comparison expressions of the individual rows are joined as a logical expression in accordance with the following hierarchy:
Notes
Example
See Selection Tables in Relational Expressions.