SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
Cannot Perform Automatic Calculations While Using the WRITE Statement
In ABAP Objects, the following statements cause an error message:
MAXIMUM f.
MINIMUM f.
SUMMING f.
...
WRITE f.
...
WRITE: / max_f, min_f, sum_f.
Correct syntax:
DATA: max_f like f,
min_f like f,
sum_f like f.
...
WRITE f.
IF max_f < f.
max_f = f.
ENDIF.
IF min_f > f.
min_f = f.
ENDIF.
sum_f = sum_f + f.
...
WRITE: / max_f, min_f, sum_f.
Cause:
These statements create the internal global variables max_f,
min_f and sum_f. To make programs more readable, you should stopy using these statements and write explicit code instead.