Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Program Flow Logic →  Expressions and Functions for Conditions →  log_exp - Logical Expressions →  rel_exp - Comparison Expressions →  rel_exp - Relational Operators →  rel_exp - Relational Operators for All Data Types 

rel_exp - Ternary Relational Operator BETWEEN

Other versions: 7.31 | 7.40 | 7.54

Syntax


... operand [NOT] BETWEEN operand1 AND operand2 ...

Effect

A comparison expression with the relational operator BETWEEN checks the content of an interval. The relational expression checks whether the content of an operand operand is within a closed interval delimited by the operands operand1 and operand2. The ternary comparison expression is equivalent to the following join between two binary comparison expressions:

... [NOT] ( operand >= operand1 AND operand <= operand2 ) ...

All operands are general expression positions and the usual comparison rules apply.


Example

Checks whether today is a working day and assigns the result to a variable declared inline.

DATA(work_day_flag) = xsdbool( sy-fdayw BETWEEN 1 AND 5 ).