function ZSTXBC_SSFCOMP_PDF_PREVIEW.
*"--------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(I_OTF) TYPE TSFOTF
*" EXCEPTIONS
*" CONVERT_OTF_TO_PDF_ERROR
*" CNTL_ERROR
*"--------------------------------------------------------------------
data: l_dummy type standard table of tline. clear: pdf_data, pdf_size. * convert otf to pdf
call function 'CONVERT_OTF'
exporting
format = 'PDF'
importing
bin_filesize = pdf_size
bin_file = pdf_data
tables
otf = i_otf[]
lines = l_dummy
exceptions
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
others = 4. if sy-subrc <> 0.
raise convert_otf_to_pdf_error.
endif. call screen 0300 starting at 1 1. endfunction.
*&+++转换成PDF
LT_OTF[] = LS_OTFDATA-OTFDATA[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
* ARCHIVE_INDEX = ' '
* COPYNUMBER = 0
* ASCII_BIDI_VIS2LOG = ' '
* PDF_DELETE_OTFTAB = ' '
* PDF_USERNAME = ' ' "don't exist
* PDF_PREVIEW = ' ' "don't exist
* USE_CASCADING = ' ' "don't exist
IMPORTING
BIN_FILESIZE = L_BIN_FILESIZE
* BIN_FILE =
TABLES
OTF = LT_OTF
LINES = LT_LINES "t_pdf_tab
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 4
OTHERS = 5.
*&PDF 预览
CALL FUNCTION 'ZSTXBC_SSFCOMP_PDF_PREVIEW'
EXPORTING
I_OTF = LT_OTF[]
EXCEPTIONS
CONVERT_OTF_TO_PDF_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
*&*********************************************************