SAP 将smartforms的报表转成PDF
生活随笔
收集整理的這篇文章主要介紹了
SAP 将smartforms的报表转成PDF
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
SAP將smartforms的報表轉成PDF
方法一:
通過調用系統(tǒng)程序:RSTXPDFT4將SAPscript (OTF)或 ABAP 清單假脫機作業(yè)轉換到 PDF
選擇畫面條件
假脫機請求 ? smartforms的脫機打印號
PDF文件名 ? 需要進行保存的pdf文件及路徑
舉例如下:
*調用SAP轉PDF的程序
SUBMIT RSTXPDFT4 VIA SELECTION-SCREENWITH SPOOLNO = LW_SP00LIDS 選擇畫面上的脫機打印機號AND RETURN.
?
?
方法二:
獲取SMARTFORMS的函數(shù)ID:
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'EXPORTINGformname = 'ZXXX'? ??? *此處為smartform名字IMPORTINGfm_name = fm_nameEXCEPTIONSno_form = 1no_function_module = 2OTHERS = 3.
?
執(zhí)行SMARTFORMS
<span style="color: black;">CALL FUNCTION fm_nameEXPORTINGcontrol_parameters = cparam </span>
<span style="color: black;">* HTH = HTH? ?? ?? ?? ? </span><span style="color: black;">此處傳入?yún)?shù)</span><span style="color: black;">output_options = outopuser_settings = spaceIMPORTINGjob_output_info = tab_otf_dataEXCEPTIONSformatting_error = 1internal_error = 2send_error = 3user_canceled = 4OTHERS = 5.</span>
?
<span style="color: black;">tab_otf_final[] = tab_otf_data-otfdata[].</span>
?
通過函數(shù):CONVERT_OTF 將smartforms轉換為PDF
<span style="color: black;">************ converting OTF data into pdf data**************************
CALL FUNCTION 'CONVERT_OTF'EXPORTINGformat = 'PDF'max_linewidth = 132
* ARCHIVE_INDEX = ' '
* COPYNUMBER = 0
* ASCII_BIDI_VIS2LOG = ' 'IMPORTINGbin_filesize = bin_filesizeTABLESotf = tab_otf_finallines = pdf_tabEXCEPTIONSerr_max_linewidth = 1err_format = 2err_conv_not_possible = 3err_bad_otf = 4OTHERS = 5.</span>
?
PDF文件下載
CALL FUNCTION 'GUI_DOWNLOAD'EXPORTINGbin_filesize = bin_filesizefilename = 'D:\TEST.PDF'filetype = 'BIN'IMPORTINGfilelength = file_sizeTABLESdata_tab = pdf_tab * FIELDNAMES =EXCEPTIONS file_write_error = 1no_batch = 2gui_refuse_filetransfer = 3invalid_type = 4no_authority = 5unknown_error = 6header_not_allowed = 7separator_not_allowed = 8filesize_not_allowed = 9header_too_long = 10dp_error_create = 11dp_error_send = 12dp_error_write = 13unknown_dp_error = 14access_denied = 15dp_out_of_memory = 16disk_full = 17dp_timeout = 18file_not_found = 19dataprovider_exception = 20control_flush_error = 21OTHERS = 22.
總結
以上是生活随笔為你收集整理的SAP 将smartforms的报表转成PDF的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ALE IDoc RFC of SAP
- 下一篇: SAP复制会计年度