Ansicht
Dokumentation

ABENOO_OBS_LOOP_1 - OO OBS LOOP 1

ABENOO_OBS_LOOP_1 - OO OBS LOOP 1

General Data in Customer Master   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

Cannot Change an Internal Table in a Loop

You cannot change a complete internal table in a loop operating on this table in ABAP Objects. Changes to the table as a whole may be caused by, for example, the REFRESH, CLEAR, FREE, MOVE, SORT, or SELECT INTO TABLE statements. This applies to internal tables from procedures and internal tables imported from a data cluster.

In ABAP Objects, the following statements cause an error message:

LOOP AT itab INTO wa.
  CLEAR itab.
ENDLOOP.

Correct syntax:

LOOP AT itab INTO wa.
  ...
ENDLOOP.
CLEAR itab.

Cause:

When the table is accessed again, system behavior will be unpredictable and may lead to runtime errors.






ABAP Short Reference   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 1100 Date: 20240420 Time: 111326     sap01-206 ( 19 ms )