Code: Alles auswählen.
REPORT Z_SAPBC460D_FM_11.
TABLES: TSP03.
DATA itab type standard table of TSP03.
DATA WA type TSP03.
select * from TSP03 into TABLE itab.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
DEVICE = 'PRINTER'
FORM = 'Z_BC460_B_1'
LANGUAGE = SY-LANGU.
loop AT itab into WA.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'DATEN'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'.
Code: Alles auswählen.
TABLES: TSP03.
DATA itab type standard table of TSP03.
DATA WA type TSP03.
select * from TSP03 into TABLE itab.
LOOP AT itab into WA.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
DEVICE = 'PRINTER'
FORM = 'Z_BC460_B_1'
LANGUAGE = SY-LANGU
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
INVALID_FAX_NUMBER = 8
MORE_PARAMS_NEEDED_IN_BATCH = 9
SPOOL_ERROR = 10.
IF SY-SUBRC <> 0.
write 'FEHLER ..................'.
ENDIF.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'DATEN'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'.
CALL FUNCTION 'CLOSE_FORM'.