Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- form zf_download_pdf using pt_smartform type zctsd_venda_comi_cab
- p_revend
- p_comissao
- p_filename.
- data: l_formname type tdsfname value 'ZSFSD_VENDA_COMISS',
- l_fm_name type rs38l_fnam,
- lw_ssfcompop type ssfcompop,
- lw_control type ssfctrlop,
- l_devtype type rspoptype,
- l_job_output type ssfcrescl,
- l_lines type table of tline,
- l_size type i .
- call function 'SSF_FUNCTION_MODULE_NAME'
- exporting
- formname = l_formname
- importing
- fm_name = l_fm_name
- exceptions
- no_form = 1
- no_function_module = 2
- others = 3.
- if sy-subrc <> 0.
- message id sy-msgid type sy-msgty number sy-msgno
- with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
- endif.
- call function 'SSF_GET_DEVICE_TYPE'
- exporting
- i_language = sy-langu
- importing
- e_devtype = l_devtype
- exceptions
- no_language = 1
- language_not_installed = 2
- no_devtype_found = 3
- system_error = 4
- others = 5.
- lw_ssfcompop-tdprinter = l_devtype.
- lw_control-no_dialog = c_x.
- lw_control-getotf = c_x.
- call function l_fm_name
- exporting
- control_parameters = lw_control
- output_options = lw_ssfcompop
- i_revend = p_revend
- i_comissao = p_comissao
- importing
- job_output_info = l_job_output
- tables
- it_venda_comi = pt_smartform
- exceptions
- formatting_error = 1
- internal_error = 2
- send_error = 3
- user_canceled = 4
- others = 5.
- if sy-subrc <> 0.
- message id sy-msgid type sy-msgty number sy-msgno
- with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
- endif.
- call function 'CONVERT_OTF'
- exporting
- format = 'PDF'
- importing
- bin_filesize = l_size
- tables
- otf = l_job_output-otfdata
- lines = l_lines
- 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
- with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
- endif.
- call function 'GUI_DOWNLOAD'
- exporting
- bin_filesize = l_size
- filename = p_filename
- filetype = 'BIN'
- tables
- data_tab = l_lines
- 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
- unknown_dp_error = 14
- access_denied = 15
- dp_out_of_memory = 16
- disk_full = 17
- dp_timeout = 18
- file_not_found = 19
- dataprovider_exception = 20
- control_flush_error = 21
- others = 22.
- if sy-subrc <> 0.
- message id sy-msgid type sy-msgty number sy-msgno
- with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
- endif.
- endform. " ZF_DOWNLOAD_PDF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement