Code: Alles auswählen.
* PDF format
ls_control_param-getotf = 'X'.
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
zxekko = l_doc-xekko " user_settings = ' '
zxpekko = l_doc-xpekko
nast = nast
IMPORTING
job_output_info = w_return
TABLES
l_xekpo = l_doc-xekpo[]
l_xekpa = l_doc-xekpa[]
l_xpekpo = l_doc-xpekpo[]
l_xeket = l_doc-xeket[]
l_xtkomv = l_doc-xtkomv[]
l_xekkn = l_doc-xekkn[]
l_xekek = l_doc-xekek[]
l_xkomk = l_xkomk
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
i_otf[] = w_return-otfdata[].
*now convert the final document (OTF format) into PDF format
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
* ARCHIVE_INDEX = ' '
* COPYNUMBER = 0
IMPORTING
bin_filesize = l_pdf_len
TABLES
otf = i_otf
lines = lt_lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
* h_gui_len = l_pdf_len.
*
* CALL FUNCTION 'GUI_DOWNLOAD'
* EXPORTING
* bin_filesize = h_gui_len
* filename = h_gui_file
* filetype = 'BIN'
* TABLES
* data_tab = lt_lines.
*
h_file_size = l_pdf_len.
i_rcgrepfile_tab[] = lt_lines[].
CALL FUNCTION 'C13Z_RAWDATA_WRITE'
EXPORTING
i_file = h_file
i_file_size = h_file_size
* I_LINES = 0
* I_FILE_OVERWRITE = ESP1_TRUE
TABLES
i_rcgrepfile_tab = i_rcgrepfile_tab
EXCEPTIONS
no_permission = 1
open_failed = 2
ap_file_exists = 3
OTHERS = 4
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Code: Alles auswählen.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
* ARCHIVE_INDEX = ' '
* COPYNUMBER = 0
IMPORTING
bin_filesize = l_pdf_len
bin_file = l_pdf_xstring " binary file
TABLES
otf = i_otf
lines = lt_lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
CONCATENATE '/Bestellungen/BIN_' l_doc-xekko-ebeln '.PDF' INTO h_file.
OPEN DATASET h_file FOR OUTPUT IN BINARY MODE.
CHECK sy-subrc EQ 0.
TRANSFER l_pdf_xstring TO h_file.
CLOSE DATASET h_file.