在输出的打印预览的情况下, 在tcode 输入 ‘ PDF! ’ ,然后就可以预览了,也可以在菜单栏的转到,找到 PDF预览的页签查看
如何转换呢
DATA:w_bin_filesize TYPE i,
gt_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA tline TYPE TABLE OF tline WITH HEADERLINE..
DATA gt_otf TYPE itcoo OCCURS 0 WITH HEADER LINE.
DATA:f_funcname TYPE rs38l_fnam.
DATA: f_formname TYPE tdsfname VALUE 'ZSCM001',
control_parameters TYPE ssfctrlop,
w_outoptions TYPE ssfcompop,
errtab TYPE tsferror.
DATA:bin_file TYPE xstring.
DATA document_output_info TYPE ssfcrespd.
DATA job_output_info TYPE ssfcrescl.
DATA job_output_options TYPE ssfcresop.
DATA: binfilesize TYPE i,
file_name TYPE string,
file_path TYPE string,
full_path TYPE string.
CLEAR control_parameters.
control_parameters-no_dialog = 'X'.
control_parameters-preview =''. "space.
control_parameters-getotf = 'X'.
* control_parameters-no_open ='X'.
* control_parameters-no_close ='X'.
control_parameters-langu = sy-langu.
w_outoptions-tddest = 'LP01'.
w_outoptions-tdnoprint = 'X'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = f_formname
IMPORTING
fm_name = f_funcname.
CALL FUNCTION f_funcname
EXPORTING
control_parameters =control_parameters
output_options = w_outoptions
user_settings = 'X'
IMPORTING
document_output_info = document_output_info
job_output_info = job_output_info
job_output_options =job_output_options
TABLES
zsscm001 = it_result.
gt_otf[] = job_output_info-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
* ARCHIVE_INDEX = ' '
* COPYNUMBER = 0
* ASCII_BIDI_VIS2LOG = ' '
* PDF_DELETE_OTFTAB = ''
IMPORTING
bin_filesize = w_bin_filesize
* bin_file = bin_file
* BIN_FILE=
TABLES
otf = gt_otf
lines = tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-subrc <>0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITHsy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL METHODcl_gui_frontend_services=>file_save_dialog
CHANGING
filename = file_name
path = file_path
fullpath = full_path.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = binfilesize
filename = full_path
filetype = 'BIN'
TABLES
data_tab = tline[]
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
|