If the selection table contains invalid values, a non-handleable exception is raised. The evaluation of a selection table requires the table to contain the valid values specified in that section in the columns sign and option. For the layout of a selection table, refer to section SELECT-OPTIONS. The selection table can be of any table category. This includes, in particular, ranges tables. 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.Īs 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. 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. Īll operands are general expression positions and the usual comparison rules apply.Ĭhecks whether today is a working day and assigns the result to a variable declared inline.ĭATA(work_day_flag) = xsdbool( sy-fdayw BETWEEN 1 AND 5 ). ( operand >= operand1 AND operand <= operand2 ). The ternary comparison expression is equivalent to the following join between two binary comparison expressions: The relational expression checks whether the content of an operand operand is within a closed interval that is delimited by the operands operand1 and operand2. Ī comparison expression with the relational operator BETWEEN checks what belongs to an interval. Rel_exp - Ternary Relational Operator BETWEEN The following table shows the binary relational operators for comparisons between two operands (data objects or return values or calculation expressions) of any data types in comparison expressions. ◈ The obsolete forms > of relational operators may still appear outside of classes. The values are compared in accordance with the comparison rules. Greater Equal: True if the value of operand1 is greater than or equal to the value of operand2. Greater Than: True if the value of operand1 is greater than the value of operand2. Not Equal: True if the value of operand1 does not match the value of operand2. Logical expression created from a predicate expression, a comparison expression, and a predicate function using the Boolean operator AND, in a control statement. The program DEMO_EXPRESSIONS also shows examples of the use of logical expressions, among other things. However, a logical expression can be executed as an argument of a Boolean function in a suitable calculation expression. ◈ Logical expressions cannot be mixed with calculation expressions. ![]() Instead, the return value of a Boolean function can be used. ◈ Since ABAP does not recognize any Boolean data objects for the truth values true and false, the result of a logical expression cannot currently be directly assigned to a data object as is the case for calculation expressions. In the case of joined relational expressions, this is true for each individual relational expression and not for the overall logical expression. ◈ If, in a logical expression, functional methods are specified as operands of a relational expression, they are executed from left to right and from inside to outside before the relational expression is evaluated. ![]() ◈ The operand positions operand of most relational expressions are general expression positions, which means that, depending on the expression, data objects, predefined functions, functional methods, calculation expressions, constructor expressions, or table expressions can be specified. ◈ In WHERE conditions of processing statements for internal tables. ◈ As an argument of a Boolean function for representing a truth value in a character-like or byte-like data object. ![]() ◈ To formulate conditions in control statements and other statements used to control the program flow. Logical expressions can be used as follows: An atomic part of a composite logical expression is always one of the following relational expressions: The result of a logical expression log_exp is a truth value and can therefore be true or false.Ī logical expression is either a single relational expression rel_exp or an expression constructed from the Boolean operators NOT, AND, OR, EQUIV and one or more logical expressions. Ī logical expression formulates a condition for operands. In addition to control structures, there are also other statements where logical expressions and functions can be specified. The following options exist for the formulation and analysis of conditions: The flow control of a program is managed by control structures that are generally controlled by logical expressions.
0 Comments
Leave a Reply. |