Code: Alles auswählen.
REPORT demo_special_tech_subroutine_2.
DATA: code TYPE TABLE OF rssource-line,
prog(8) TYPE c, msg(120) TYPE c, lin(3) TYPE c,
wrd(10) TYPE c, off(3) TYPE c.
APPEND 'PROGRAM SUBPOOL.' TO code.
APPEND 'Types: BEGIN OF s,' TO code.
APPEND 'feld1 type c,' TO code.
APPEND 'feld2 type c,' TO code.
APPEND 'feld3 type c,' to code.
APPEND ' END OF s.' TO code.
APPEND 'Types: m type standard table of s with default key.' TO code.
APPEND 'DATA: Z_TAB type m,' TO code.
APPEND 'WA_Z_TAB LIKE LINE OF Z_TAB.' TO code.
GENERATE SUBROUTINE POOL code NAME prog
MESSAGE msg
LINE lin
WORD wrd
OFFSET off.
IF sy-subrc <> 0.
WRITE: / 'Error during generation in line', lin,
/ msg,
/ 'Word:', wrd, 'at offset', off.
ELSE.
WRITE: / 'The name of the subroutine pool is', prog.
ENDIF.
Code: Alles auswählen.
DATA: begin of itab usw.
FORM filldata.
select usw in Felder ITAB.
write: / itab-feld1.
write: / itab-feld2.
etc.
ENDFORM.
Code: Alles auswählen.
GENERATE SUBROUTINE POOL GT_QUELLTEXT NAME GV_SUBROUTINEPOOL
Code: Alles auswählen.
Perform filldata in program (gv_subroutinepool).