Code: Alles auswählen.
OPEN CURSOR g_cursor FOR
SELECT DISTINCT (v_columns) FROM XYZ.
DO.
FETCH NEXT CURSOR g_cursor
INTO TABLE <dyntable_2>
PACKAGE SIZE 1000.
IF sy-subrc NE 0.
CLOSE CURSOR g_cursor.
EXIT.
ENDIF.
LOOP AT <t_dyntable_2> ASSIGNING
<wa_dyntable>.
* Verarbeitung
IF ...
INSERT <wa_t_dyntable> INTO TABLE <dyntable>.
...
ENDIF.
PERFORM download.
ENDLOOP.
FREE <wa_dyntable>.
FREE <dyntable>.
FREE <dyntable_2>.
ENDDO.