欢迎来到天天文库
浏览记录
ID:42603307
大小:19.29 KB
页数:4页
时间:2019-09-18
《ABAP:Smartform生成PDF》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、注意:生成PDF时,Smartform中的参数control_parameters-getotf='X'.必须*&-----------------------------------------------------------**&REPORTZHARPO_010*&*&-----------------------------------------------------------**&*&Smartform生成PDF,可设置不显示Smartform打印窗口*&----------------------------------
2、-------------------------* REPORTzharpo_010NOSTANDARDPAGEHEADING. TABLESrlgrap.DATAfm_nameTYPErs38l_fnam.DATAcontrol_parametersTYPEssfctrlop.DATAjob_output_infoTYPEssfcrescl.DATAjob_output_optionsTYPEssfcresop.DATAitabTYPETABLEOFbkpf.DATABEGINOFpdfOCCURS10.INCLUDESTRUCTURE
3、tline.DATAENDOFpdf.DATAlenTYPEi."PDF文件大小 PARAMETERSfilenameTYPErlgrap-filename. ATSELECTION-SCREENONVALUE-REQUESTFORfilename.PERFORMf4_file_saveCHANGINGfilename. START-OF-SELECTION.SELECTbukrsbelnrbldatUPTO300ROWSINTOCORRESPONDINGFIELDSOFTABLEitabFROMbkpf. control_paramet
4、ers-getotf='X'."此参数必须,否则不会导出PDF而直接显示smartformcontrol_parameters-no_close=''.control_parameters-no_dialog='X'."不显示打印对话框 CALLFUNCTION'SSF_FUNCTION_MODULE_NAME'EXPORTINGformname='ZHARPO_001'IMPORTINGfm_name=fm_nameEXCEPTIONSno_form=1no_function_module=2OTHERS=3. CHECK:sy-subr
5、c=0. CALLFUNCTIONfm_nameEXPORTINGcontrol_parameters=control_parametersIMPORTINGjob_output_info=job_output_infojob_output_options=job_output_optionsTABLESitab2=itabEXCEPTIONSformatting_error=1internal_error=2send_error=3user_canceled=4OTHERS=5. CHECK:sy-subrc=0. *convertsma
6、rtformstoPDFCALLFUNCTION'CONVERT_OTF'EXPORTINGformat='PDF'IMPORTINGbin_filesize=lenTABLESotf=job_output_info-otfdatalines=pdfEXCEPTIONSerr_max_linewidth=1err_format=2err_conv_not_possible=3OTHERS=4. CHECK:sy-subrc=0. CALLFUNCTION'WS_DOWNLOAD'EXPORTINGfilename=filenamefilet
7、ype='BIN'bin_filesize=lenTABLESdata_tab=pdfEXCEPTIONSfile_open_error=1file_write_error=2invalid_filesize=3invalid_table_width=4invalid_type=5no_batch=6unknown_error=7OTHERS=8. IFsy-subrc<>0.MESSAGE'ERROR!'TYPE'E'.ENDIF.*&----------------------------------------------------
8、-------**&FormF4_FILE_SAVE*&-----------------------------------------------------------**
此文档下载收益归作者所有