Ansicht
Dokumentation

ABENOO_OBS_SUMMING_2 - OO OBS SUMMING 2

ABENOO_OBS_SUMMING_2 - OO OBS SUMMING 2

CPI1466 during Backup   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.
SAP E-Book

Cannot Perform Automatic Calculations While Using the WRITE Statement

In ABAP Objects, you cannot use MAXIMUM, MINIMUM, or SUMMING to calculate values automatically when creating basic lists 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.






ABAP Short Reference   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 1456 Date: 20240329 Time: 163943     sap01-206 ( 26 ms )