ARTICLE
Reading Data Through the Cursor
The example shows how to read data through the cursor.
ABAP_SOURCE_CODE
ABAP_EXEC
ABAP_DESCRIPTION
The system opens two cursors for the tables SPFLI and SFLIGHT
. Since both tables are linked through a foreign key relationship,
you can define a nested loop over the tables by sorting the selection by
the primary key; the system then reads the data of the inner loop
dependently on the data of the outer loop. This way of programming is
more efficient than the usage of nested SELECT loops since the
cursor for the inner loop needs not be reset again and again. In a
control level change in the inner loop, the system temporarily stores
the data read until the next loop pass since it is not possible to reset
the cursor.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved