SAP WHERE LOGEXP LIST IN Get Example source ABAP code based on a different SAP table
SAP Help
Short Reference > ABAP_SQLCOND > - ( operand1, operand2, ... ) IN ( ... )> ABAP_SYNTAX ... ( operand1, operand2$[, ...$] ) IN ${ ( ( operand11, operand21$[, ...$] )$[, ( operand12, operand22$[, ...$] )$] ) $} $| ${ ( SELECT subquery_clauses> $[ UNION$|INTERSECT$|EXCEPT ...>$] ) $} ...> ABAP_VARIANTS: 1 ... ( operand1, operand2$[, ...$] ) IN ( ( operand11, operand21$[, ...$] )$[, ...$] ) )> 2 ... ( operand1, operand2$[, ...$] ) IN ( SELECT subquery_clauses [UNION$|INTERSECT$|EXCEPT ...] )> What does it do? Checks whether the values of the operands operand1>, operand2 >, ... specified on the left side as a parenthesized comma-separated list match a value tuple from a set of value tuples specified in parentheses. The set of value tuples can be specified as follows: Using a comma-separated list of parenthesized tuples ( operand11, operand21[, ...] )>, ( operand12, operand22[, ...] )>, ... Using a subquery>. The following applies to operand1>, operand2>, ...: Any SQL expressions> except aggregate expressions> and window expressions> can be specified. Aggregate expressions> can be used in a HAVING>> clause. At least one blank must be placed after every opening parenthesis and in front of every closing parenthesis. The comma-separated list operand1>, operand2>, ... must contain at least two elements. Latest notes: The operator NOT> is currently not supported. NON_V5_HINTS ABAP_HINT_END ABAP_VARIANT_1 ... ( operand1, operand2$[, ...$] ) IN ( ( operand11, operand21$[, ...$] )$[, ...$] ) )> What does it do? This relational expression is true if the value of every operand operand1>, operand2>, ... on the left side matches the content of the operand of a parenthesized value tuple ( operand11, operand21[, ...] )> in the same place on the right side. Every value tuple must contain the same number of elements as the comma-separated list operand1>, operand2>, ... on the left side. The value tuples themselves are specified as a parenthesized comma-separated list , which can also consist of only one element. operand11>, operand21>, ... of a value tuple can be any SQL expressions> except window expressions>. Aggregate expressions> are currently only possible in a HAVING>> clause. Literals>, host variables>, and host expressions> are handled like elementary SQL expressions>, which means they are mapped to dictionary types instead of being converted. Latest notes: This variant of IN> can also be expressed using individual comparisons combined using AND> and OR> and the comparison operator =>>, but SQL expressions are not possible on the right side. This is also how this variant of IN> is distinguished from the variant with a single operand>. When this variant of IN> is used, AB_SQL bypasses table buffering>. NON_V5_HINTS When used, this variant of IN> applies the ABAP_STRICT_777 strict mode from ABAP_RELEASE ABAP_777 / . ABAP_HINT_END ABAP_EXAMPLE_VX5 The query finds all rows in which the values of the three columns on the left side match one of the two value tuples on the right side. ABEXA 01405 ABAP_EXAMPLE_END ABAP_VARIANT_2 ... ( operand1, operand2$[, ...$] ) IN ( SELECT subquery_clauses [UNION$|INTERSECT$|EXCEPT ...] )> What does it do? This relational expression is true if the value of every operand operand1>, operand2>, ... on the left side matches the content of the result set of the subquery>. The result set of the subquery must contain the same number of elements in the same position as in the comma-separated list operand1>, operand2>, ... on the left side. The set operators> UNION>>, INTERSECT>>, and EXCEPT>> can be used to combine the result sets of multiple subqueries. In this case, the rules for query_clauses>> apply. Latest notes: NON_V5_HINTS When used, this variant of IN> applies the ABAP_STRICT_778 strict mode from ABAP_RELEASE ABAP_778 / . ABAP_HINT_END ABAP_EXAMPLE_VX5 Reads the country of origin and the country of destination from the DDIC database table SPFLI> for all flights which cost more than USD 100. The condition 'price > 100' is checked in a subquery that reads from the DDIC database table SFLIGHT>. ABEXA 01437 ABAP_EXAMPLE_END