Академический Документы
Профессиональный Документы
Культура Документы
2. l_fp = cl_fp=>get_reference( ).
3.
4. TRY.
5. * Create PDF Object.
6. l_pdfobj = l_fp->create_pdf_object( connection = p_dest ).
7.
8. * Set document.
9. l_pdfobj->set_document( pdfdata = l_pdf ).
10.
11. * Set attachment.
12. CONCATENATE 'Attachment' sy-uzeit INTO l_attachment-name
13. SEPARATED BY space. "#EC NOTEXT
14. l_filename = p_att.
15. CALL FUNCTION 'SPLIT_FILENAME'
16. EXPORTING
17. long_filename = l_filename
18. IMPORTING
19. pure_filename = l_short
20. pure_extension = l_ext.
21. CONCATENATE l_short l_ext INTO l_attachment-filename
22. SEPARATED BY '.'.
23. CALL FUNCTION 'SKWF_MIMETYPE_OF_FILE_GET'
24. EXPORTING
25. filename = l_filename
26. IMPORTING
27. mimetype = l_mimetype.
28. l_attachment-mimetype = l_mimetype.
29. l_attachment-description = l_attachment-name.
30. l_attachment-data = l_att.
31. INSERT l_attachment INTO TABLE l_attachments.
32. l_pdfobj->set_attachments( attachments = l_attachments ).
33.
34. * Execute, call ADS.
35. l_pdfobj->execute( ).
36.
37. * Get result.
38. l_pdfobj->get_document( IMPORTING pdfdata = l_pdf ).
39.
40. CATCH cx_fp_runtime_internal
41. cx_fp_runtime_system
42. cx_fp_runtime_usage INTO l_fpex.
43. PERFORM error USING l_fpex.
44. ENDTRY.
==================================================================================
=
REFRESH it_item1.
CLEAR:wa_item.
CLEAR wa_item.
ENDLOOP.
EXPORTING
control_parameters = st_control_parameters
output_options = st_output_options
wa_header = wa_header
IMPORTING
document_output_info = st_document_output_info
job_output_info = st_job_output_info
job_output_options = st_job_output_options
TABLES
it_item = it_item1
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc NE 0.
ENDIF.
CLEAR wa_pdf.
ENDLOOP.
CLEAR wa_header.
ENDLOOP.
IMPORTING
bin_filesize = v_bin_filesize
TABLES
otf = it_pdf
doctab_archive = it_docs
lines = it_lines
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
ENDIF.
EXPORTING
i_otf = it_pdf
EXCEPTIONS
convert_otf_to_pdf_error = 1
cntl_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
EXPORTING
default_extension = 'pdf'
default_file_name = v_name
file_filter = v_filter
CHANGING
filename = v_name
path = v_path
fullpath = v_fullpath
user_action = v_uact.
IF v_uact = v_guiobj->action_cancel.
EXIT.
ENDIF.
found one you can download to your PC as a PDF.
But you need to convert PDF to binary both files and append each then convert pdf download in
local drive.
report zfile_access.
data : g_path(128),
line type x,
end of gt_lines.
g_path = 'P:\FEMS_ABC\2850_specs.pdf'.
t_path = 'c:\temp\2850_specs.pdf'.
if sy-subrc = 0.
clear : lt_value.
refresh : lt_value.
do.
if sy-subrc = 0.
append gt_lines.
else.
exit.
endif.
enddo.
endif.
you append both binary files in gt_lines and download to t_path(.pdf) it will show nice pdf format.
exporting
filename = t_path
filetype = 'BIN'
tables
data_tab = gt_lines
Former Member
September 27, 2016 1 minute read
Hi all,
I am sharing my new development scenario.
Scenario:
Multiple documents are being printed at the Shipment Complete step. This process happens many times a day and
for more than 1 Shipment at a time. If all these documents print at the same time, a user will need to sort through all
the documents and figure out which print goes with which shipment.
Solution:
For this issue four FM’s are used.
1. RSPO_RETURN_SPOOLJOB
2. RSPO_SR_OPEN
3. RSPO_SR_TABLE_WRITE
4. RSPO_SR_CLOSE
Detailed: