Does ABAP have a defined order of evaluation? For example, in an expression foo( ) + bar( ), is there a guarantee which of the methods foo( ) and bar( ) is evaluated/executed first? Couldn't find such info in the ABAP Keyword Documentation.
Does ABAP have a defined order of evaluation? For example, in an expression foo( ) + bar( ), is there a guarantee which of the methods foo( ) and bar( ) is evaluated/executed first? Couldn't find such info in the ABAP Keyword Documentation.
ABAP documentation: arith_exp - Arithmetic Operators:
The table shows the possible arithmetic operators for arithmetic expressions, their priority, and the order in which the calculation is performed.
Within a parenthesis level, calculations with operators of higher priority are performed before calculations with operators of lower priority.
For adjacent operators of the same priority, the calculation is performed in the order specified.
In the third column of the table below, 3 indicates the highest priority and 1 the lowest.
Operator Priority Order
+ 1 From left to right
- 1 From left to right
* 2 From left to right
/ 2 From left to right
DIV 2 From left to right
MOD 2 From left to right
** 3 From right to left