
DATA(lo_pdf_helper) = NEW cl_rspo_pdf_merge( ).
DATA fm_name TYPE rs38l_fnam.
DATA job_output_info TYPE ssfcrescl.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'MY_SMARTFORM'
IMPORTING
fm_name = fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
DATA(control_parameters) = VALUE ssfctrlop( getotf = abap_true
no_dialog = abap_true ).
DATA(output_options) = VALUE ssfcompop( tdcopies = 3 ). " however many copies are needed
CALL FUNCTION fm_name
EXPORTING
control_parameters = control_parameters
output_options = output_options
... = ...
IMPORTING
job_output_info = job_output_info
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
DATA bin_file TYPE xstring
DATA lines TYPE tline_tab.
DO output_options-tdcopies TIMES.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
copynumber = CONV rspocopies( sy-index )
IMPORTING
bin_file = bin_file
TABLES
otf = job_output_info-otfdata[]
lines = lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc IS INITIAL.
lo_pdf_helper->add_document( bin_file ).
ENDIF.
ENDDO. " output_options-tdcopies
lo_pdf_helper->merge_documents(
IMPORTING
merged_document = DATA(merged_document)
).
DATA bin_tab TYPE ty_xline_tabtype.
DATA filename TYPE string.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = merged_document
TABLES
binary_tab = bin_tab.
DATA(lo_gui) = NEW cl_gui_frontend_services( ).
lo_gui->gui_download(
EXPORTING
filename = filename
filetype = 'BIN'
CHANGING
data_tab = bin_tab
).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |