Ansicht
Dokumentation

ABENLOGEXP_SELECT_OPTION - LOGEXP SELECT OPTION

ABENLOGEXP_SELECT_OPTION - LOGEXP SELECT OPTION

General Material Data   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

- Tabular Comparison Operator IN

... operand $[NOT$] IN range_tab ...

Effect

In a comparison expression with the comparison operator IN, the conditions of a ranges table or a table of this structure are checked. This means whether an operand operand is checked to see whether it meets the conditions in the lines of the ranges table or not, if the addition NOT is specified. The tabular comparison expression is equivalent to a combination of binary or ternary comparison expressions whose number is determined by the number of lines in the internal table.

Any internal table whose line type matches that of a ranges table or a functional method with the corresponding type of return value can be specified as a table range_tab. This includes, in particular, selection tables. The ranges table can be of any table type. For the structure of a ranges tables, see TYPES RANGE OF. The evaluation of a ranges table requires it to contain the valid values listed there in the columns sign and option. If the ranges table contains invalid values, an uncatchable exception is raised. If the ranges table is initial, the comparison expression is always true.

Each line of a non-initial ranges table is included in the combination using one of the following comparison expressions. Depending on the operator in the column option, this is a comparison between two operands using a binary comparison operator or an interval restriction using the ternary operator BETWEEN.

  • The operators "EQ", "NE", "GE", "GT", "LE", and "LT" produce a size comparison:
... operand ${EQ$|NE$|GE$|GT$|LE$|LT$} range_tab-low ...
The comparison operator is derived from the content of the column range_tab-option and the content of the column range_tab-low is used as the right operand.
  • The operators "CP" and "NP" produce a string comparison:
... operand ${CP$|NP$} range_tab-low && range_tab-high
The comparison operator is derived from the content of the column range_tab-option and the content of the columns range_tab-low and range_tab-high is concatenated as the right operand.
  • The operators "BT" and "NB" produce a delimitation of an interval:
... operand $[NOT$] BETWEEN range_tab-low AND range_tab-high ...
The comparison is executed without the addition NOT if the content of the column range_tab-option is "BT" and with the addition NOT if the content is "NB". The content of the columns range_tab-low and range_tab-high is used for the interval restrictions.

operand is a general expression position and the usual comparison rules apply to operand and the columns low and high of the ranges table. The comparison expressions of the individual lines are combined into a logical expression in accordance with the following hierarchy:

  1. The expressions of all lines that contain "I" in the column sign are combined using OR. If there are no lines that contain "E" in the column sign, this represents the entire logical expression.
  2. The expressions of all lines that contain "E" in the column sign are combined using OR and then negated using NOT. If there are no lines that contain "I" in the column sign, this represents the entire logical expression.
  3. If the content "I" and the content "E" are both in the column sign, AND is used to combine the logical expression that is produced by step 1 with the logical expression from step 2

Notes

  • The rules above can be interpreted in such a way that the lines containing "I" or "E" in the column sign describe two value sets. The set for "I" is the inclusive set and the set for "E" is the exclusive set. By subtracting the exclusive set from the inclusive set, a result set is calculated that contains all values for which the entire logical expression is true.
  • The comparison rules are checked only at runtime and comparisons that are not allowed lead to exceptions.
  • The operator IN is, due to its implementation using binary comparison operators, not suitable for selecting natural-language text content.

Example

Filling of a ranges table with a SELECT statement and its use in a logical expression in the conditional operator COND.

Ranges Tables in Comparison Expressions






CPI1466 during Backup   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 8415 Date: 20240426 Time: 145341     sap01-206 ( 85 ms )