Code: Alles auswählen.
OPEN CURSOR WITH HOLD lv_cursor
FOR
SELECT kna1~kunnr
kna1~name1
[..]
FROM kna1
JOIN knb1
ON knb1~kunnr EQ kna1~kunnr
WHERE [..]
DO.
FETCH NEXT CURSOR lv_cursor
INTO TABLE lt_kna1
PACKAGE SIZE 10000.
IF sy-subrc = 0.
* Datenbank-Commit
EXEC SQL.
COMMIT WORK
ENDEXEC.
ELSE. "keine Daten mehr zum Verarbeiten
CLOSE CURSOR lv_cursor.
EXIT.
ENDIF.
ENDDO.
Code: Alles auswählen.
SELECT [..] FROM kna1
JOIN knb1
ON knb1~kunnr EQ kna1~kunnr
WHERE [..]
INTO TABLE lt_kna1
PACKAGE SIZE 10000.
LOOP AT lt_kna1 ASSIGNING <lf_data>.
"data processing
ENDLOOP.
ENDSELECT.