sapdev logo background
sapdev logo sapdev logo
Comments

SAP OO OBS LOOP 1 documentation, setup help and example usage



Return to SAP documentation index


INCLUDE
ARTICLE

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.
    Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




    OO_OBS_LOGICAL_1
    OO_OBS_LOOP_DBTAB_1




    comments powered by Disqus