REPORT ZDYNAMIC_ITAB_08.
TABLES : SFLIGHT.
SELECT-OPTIONS : S_CARRID FOR SFLIGHT-CARRID,
S_FLDATE FOR SFLIGHT-FLDATE.
DATA : GT_SFLIGHT LIKE SFLIGHT OCCURS 0 WITH HEADER LINE,
L_TEXT(72),
L_CNT(2) TYPE C.
DATA : BEGIN OF L_SRC_ST_IT OCCURS 0,
TEXT(72),
END OF L_SRC_ST_IT.
SELECT * INTO TABLE GT_SFLIGHT
FROM SFLIGHT
WHERE CARRID IN S_CARRID
AND FLDATE IN S_FLDATE.
CLEAR : L_CNT.
SORT GT_SFLIGHT BY FLDATE.
CLEAR : L_SRC_ST_IT.
L_SRC_ST_IT-TEXT = '*& Include ZDYNAMIC_ITAB_08TOP *'.
APPEND L_SRC_ST_IT.
CLEAR : L_SRC_ST_IT.
L_SRC_ST_IT-TEXT = 'DATA : BEGIN OF GT_FLDATE OCCURS 0,'.
APPEND L_SRC_ST_IT.
CLEAR : L_SRC_ST_IT.
L_SRC_ST_IT-TEXT = ' CARRID LIKE SFLIGHT-CARRID,'.
APPEND L_SRC_ST_IT.
CLEAR : L_SRC_ST_IT.
LOOP AT GT_SFLIGHT.
ON CHANGE OF GT_SFLIGHT-FLDATE.
L_CNT = L_CNT + 1.
CONCATENATE ' FLDATE' L_CNT ' LIKE SFLIGHT-FLDATE,' INTO L_TEXT.
L_SRC_ST_IT-TEXT = L_TEXT.
APPEND L_SRC_ST_IT.
CLEAR : L_SRC_ST_IT.
ENDON.
ENDLOOP.
L_SRC_ST_IT-TEXT = ' END OF GT_FLDATE.'.
APPEND L_SRC_ST_IT.
INSERT REPORT 'ZDYNAMIC_ITAB_09_TOP' FROM L_SRC_ST_IT.
EXPORT GT_SFLIGHT TO MEMORY ID 'TEST_ID'.
CALL TRANSACTION 'ZDYNAMIC_ITAB_09' AND SKIP FIRST SCREEN.