Ansicht
Dokumentation

SY-SUBRC for LOOP via extracts, ext. and int. table <br />Tip-No.: 1800 ( INFO1800 )

SY-SUBRC for LOOP via extracts, ext. and int. table
Tip-No.: 1800 ( INFO1800 )

Fill RESBD Structure from EBP Component Structure   General Data in Customer Master  
This documentation is copyright by SAP AG.
SAP E-Book

Short text

SY-SUBRC for LOOP via extracts, ext. and int. table
Tip-No.: 1800

Symptom

The different variants of ABAP/4 language element LOOP ... ENDLOOP
treat system field SY-SUBRC differently:

- with a LOOP via internal table, the SY-SUBRC is set; after the
ENDLOOP it is set to:
0 , if the loop was run through at least once,
&lt;&gt; 0 , if the loop was not run through.

- with a LOOP via extracts and with LOOP via DB tables, the SY-SUBRC
is not set by the system.

Cause

A simplification of the SY-SUBRC handling in the various LOOP variants
that always displayed the SY-SUBRD after ENDLOOP, whether the loop
was run though or not, is generally desirable.

As this would be an incompatible change, however, the current status
will be maintained for a while.

Solution

For LOOP via extracts or DB tables, you may have to use a proprietary
flag to check whether the loop was run through or not.

For this, however, do not program that the SY-SUBRC is manipulated by
the system for LOOP via extracts and DB tables (in order to provide
for later simplification of the programming).






General Data in Customer Master   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 1310 Date: 20240328 Time: 224419     sap01-206 ( 13 ms )