sapdev logo background
sapdev logo sapdev logo
Comments

SAP LOOP GUIDL documentation, setup help and example usage



Return to SAP documentation index


GUIDELINE

Loop Processing

ABAP_BACKGROUND
Alongside the statements for editing individual rows in internal tables, other statements can be used to address and modify the entire body of the table. Examples:
  • All categories of assignments applying to whole internal tables

  • Deleting the whole of an internal table using CLEAR or FREE


  • Operations in target ranges such as SELECT INTO TABLE

  • These types of accesses to the table body cause problems by producing a loop across the internal table

    ABAP_RULE
    Do not modify the entire table body in a loop
    You cannot use a loop across an internal table to perform accesses to the table that modify the entire table body at once.

    ABAP_DETAILS
    A modifying access to the entire table body usually produces a runtime error and at the very least unpredictable program behavior. If this can be detected statically, a syntax error occurs within classes and also in
    LOOP s with a statically detectable secondary key when the table operations in question are used. Otherwise, the syntax check simply retu
    rns a warning for compatibility reasons.

    Note
    This rule is mainly intended to make you more away of the problem. If you only work with ABAP Objects or if no syntax check warnings are ignored, then the rule above should be kept automatically.
    Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




    LOOP_GLOSRY
    LOSSLESS_ASSIGNMENT_GLOSRY




    comments powered by Disqus