Use the following logical expression to check whether the value of a field lies within a particular range:
.... <f1> BETWEEN <f2> AND <f3> .....
The expression is true if the value of <f1> lies in the interval between <f2> and <f3>. It is a shortened form of the following expression:
IF <f1> GE <f2> AND <f1> LE <f3>.
The operands may have different data types. If necessary, they are converted as described in
Comparisons Between Data Types.
DATA: NUMBER TYPE I,
FLAG.
...
NUMBER = ...
...
IF NUMBER BETWEEN 3 AND 7.
FLAG = 'X'.
ELSE.
FLAG = ' '.
ENDIF.
In this example, the value of the field FLAG is set to X if the value of NUMBER is between 3 and 7.