SAP WHERE LOGEXP OPERAND IN



Get Example source ABAP code based on a different SAP table
  


Short Reference

ABAP_SQLCOND - operand IN ( ... )

ABAP_SYNTAX
... operand $[NOT$] IN ${ (operand1$[, operand2$[, ...$]$]) $}
$| ${ ( SELECT subquery_clauses $[ UNION$|INTERSECT$|EXCEPT ...$] ) $} ...

ABAP_VARIANTS:
1 ... operand $[NOT$] IN (operand1$[, operand2$[, ...$]$])
2 ... operand $[NOT$] IN ( SELECT subquery_clauses [UNION $|INTERSECT$|EXCEPT ...] )

What does it do?
Checks whether the value of an operand operand matches a value in a set of values specified in parentheses. The set of values can be specified as follows:
Using a comma-separated list of individual literals or host variables.
Using a scalar subquery.
The following applies to operand:
SQL expressions except for aggregate expressions and window expressions can be specified.
Aggregate expressions can also be used in a HAVING clause.

ABAP_VARIANT_1 ... operand $[NOT$] IN (operand1$[, operand2$[, ...$]$])

What does it do?
This relational expression is true if the value of the operand operand matches (does not match) the content of one of the operands operand1, operand2 ... in a parenthesized comma-separated value list.
The following applies to operand1, operand2, ...:
Literals and host variables can be specified.
The content of untyped literals and host variables must match the data type of operand in accordance with the rules for lossless assignments.
BEGIN_SECTION VERSION 5 OUT This is checked by the strict modes of the syntax check from ABAP_RELEASE ABAP_740_SP08 and can produce a syntax error or raise an exception.
END_SECTION VERSION 5 OUT
It is also possible to specify just one operand operand1 in the parentheses. Blanks can be placed after the opening parenthesis, in front of the closing parenthesis, and after the commas. If blank is placed after the opening parenthesis, there must also be a blank in front of the closing parenthesis.



Latest notes:

No columns col, no host expressions, and no other SQL expressions can be specified here on the right side. SQL expressions are, however, specified in the variant of IN with an operand list.
NON_V5_HINTS
ABAP_HINT_END

ABAP_EXAMPLE_VX5
Reads the bookings in which the class is not in the value range (C - Business, F - First, Y - Economy) of the corresponding domain in the ABAP Dictionary.
ABEXA 01407
ABAP_EXAMPLE_END

ABAP_VARIANT_2 ... operand $[NOT$] IN ( SELECT subquery_clauses [UNION$|INTERSECT$|EXCEPT ...] )

What does it do?
This relational expression is true if the value of the operand operand is (is not) contained in the result set of a subquery. The clauses in the subquery subquery_clauses must represent a scalar subquery. The set operators UNION, INTERSECT , and EXCEPT can be used to combine the result sets of multiple subqueries. In this case, special rules query_clauses apply when specifying clauses.

ABAP_EXAMPLE_VX5
Reads the geographical latitude and longitude of a city from the DDIC database table SGEOCITY, where this city is the city of origin of a flight in the DDIC database table SPFLI.
ABEXA 01408
ABAP_EXAMPLE_END