data: PROG type STRING,
TAB type standard table of STRING,
MESS type STRING,
SID type STRING.
append 'PROGRAM subpool.' to TAB.
append `DATA EKKO_tab TYPE TABLE OF EKKO.` to TAB.
append `LOAD-OF-PROGRAM.` to TAB.
append ` SELECT *` &
` FROM EKKO` &
` INTO TABLE EKKO_tab.` to TAB.
append `FORM loop_at_tab.` to TAB.
append ` DATA EKKO_wa TYPE EKKO.` to TAB.
append ` LOOP AT EKKO_tab INTO EKKO_wa.` to TAB.
append ` PERFORM evaluate_wa USING EKKO_wa.` to TAB.
append ` ENDLOOP.` to TAB.
append `ENDFORM.` to TAB.
append `FORM evaluate_wa USING l_wa TYPE EKKO.` to TAB.
append ` WRITE: / l_wa-EBELN, l_wa-AEDAT.` to TAB.
append `ENDFORM.` to TAB.
generate subroutine pool TAB name PROG
message MESS
shortdump-id SID.
if SY-SUBRC = 0.
perform ('LOOP_AT_TAB') in program (PROG) if found.
elseif SY-SUBRC = 4.
message MESS type 'I'.
elseif SY-SUBRC = 8.
message SID type 'I'.
endif.