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

rel_exp - Ternary Relational Operator BETWEEN

Syntax

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

Effect

A comparison expression with the relational operator BETWEEN checks what belongs to an interval. 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. 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) = boolc( sy-fdayw BETWEEN 1 AND 5 ).