AS ABAP Release 758, ©Copyright 2024 SAP SE. All rights reserved.
ABAP - Keyword Documentation → ABAP - Programming Guidelines → Structure and Style → Alternative Spellings →Calculations
Background
In ABAP, the arithmetic operators in arithmetic expressions are used for numeric calculations. Calculation assignments with the operators +=, -=, *=, and /= are available for the basic arithmetic operations. These operator formats are accompanied by the dedicated ABAP keywords ADD, SUBTRACT, MULTIPLY, and DIVIDE.
Rule
Use the operator format
For calculations, use the operator format with the operators (+=, -=, *=, or /=) instead of the ABAP keyword format.
Details
Calculations with the statements ADD, SUBTRACT, MULTIPLY, and DIVIDE do not allow expressions in the operand positions and are often more difficult to read than the corresponding operator format.
Bad Example
The following source code shows a multiplication using the statement MULTIPLY.
Good Example
The following source code shows the same example as above, but in the more compact operator format.