
Expressions
In ABAP, an expression is either a calculation expression or a logical expression. A logical expression can contain calculation expressions. A calculation expression can be located on the right of an assignment and in all suitable operand positions. This is not directly possible for logical expressions (but is possible as an argument of a predefined function boolc( ... )).
Calculation expressions are either arithmetic expressions, string expressions, or bit expressions. Arithmetic expressions join numeric operands using numeric operators ( +, -, *, /, DIV, MOD, **). String expressions chain strings using && or format them in string templates |…|. Bit expressions join binary operands using bit operators ( BIT-NOT, BIT-AND, BIT-OR, BIT-XOR).
A logical expression is either true or false. Logical expressions join operands using logical relational operators or special language elements. Alongside the regular relational operators ( =, >, <, >=, <=, <>), there are special operators such as CS (contains string) or CP (contains pattern) for comparisons between byte strings and character strings. Language elements for logical expressions include BETWEEN, for checking a value interval, or IS INITIAL, for checking the initial value. Logical expressions can be negated using NOT and joined using AND and OR. Expressions joined in this way are evaluated from left to right until a result is produced. Logical expression are also used in the formulation of conditions in control statements, such as IF.
Predefined Functions
ABAP contains a large group of predefined functions that can be specified in operand positions as func( ... ). As well as predefined functions, function method calls meth( ... ) can also be located in the operand positions.