在se71設計的報表
可以用open_form呼叫它
裡面有很多參數
DATA: l_itcpo LIKE ITCPO OCCURS 0 WITH HEADER LINE.
CLEAR l_itcpo.
CLEAR l_itcpo-tddest.
如果要直接列印的話
l_itcpo-TDPREVIEW = ''. "實際列印
l_itcpo-TDNOPRINT = ''.
如果要預覽不要列印的話
l_itcpo-tddest = 'LOCL'.
l_itcpo-TDPREVIEW = 'X'. "預覽
l_itcpo-TDNOPRINT = 'X'.
l_itcpo-tddelete = 'X'. "列印後刪除
l_itcpo-TDIMMED = 'X'. "立即列印
l_itcpo-TDLIFETIME = 0.
call function 'OPEN_FORM'
exporting
form = 'ZXXPRT01' "==報表
language = sy-langu
device = 'PRINTER'
dialog = ' ' "==不顯示列印參數畫面
options = l_itcpo
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
others = 11.
IF sy-subrc <> 0.
PERFORM protocol_update.
ENDIF.
如果要在報表裡面放圖片的話
要先用TCODE:SE78先上傳圖片
Form Graphics -> Stored on Document Server -> GRAPHICS General Graphics
->BMAP Bitmap Images點一下後就可以從右邊去上傳圖片,然後上傳要取一個圖片名字
假設取的名字是LOGOIMG
接下來只要在se71裡面拉一個視窗出來,裡面放這行程式,圖片就會出現的
BITMAP 'LOGOIMG' OBJECT GRAPHICS ID BMAP TYPE BCOL