<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: function module to down load the pdf in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-down-load-the-pdf/m-p/6025338#M1348332</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To Convert Smartform to PDF and store in desktop,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZTEST_NREDDY_PDF
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
REPORT  ZTEST_NREDDY_PDF.
* Internal table declaration
DATA: it_otf      TYPE STANDARD TABLE OF itcoo,
      it_docs     TYPE STANDARD TABLE OF docs,
      it_lines    TYPE STANDARD TABLE OF tline.
* Declaration of local variables.
DATA:
      st_job_output_info       TYPE ssfcrescl,
      st_document_output_info  TYPE ssfcrespd,
      st_job_output_options    TYPE ssfcresop,
      st_output_options        TYPE ssfcompop,
      st_control_parameters    TYPE ssfctrlop,
      v_len_in                 TYPE so_obj_len,
      v_language               TYPE sflangu VALUE 'E',
      v_e_devtype              TYPE rspoptype,
      v_bin_filesize           TYPE i,
      v_name                   TYPE string,
      v_path                   TYPE string,
      v_fullpath               TYPE string,
      v_filter                 TYPE string,
      v_uact                   TYPE i,
      v_guiobj                 TYPE REF TO cl_gui_frontend_services,
      v_filename               TYPE string,
      v_fm_name                TYPE rs38l_fnam.
CONSTANTS c_formname           TYPE tdsfname VALUE 'ZTEST'.
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
  EXPORTING
    i_language          = v_language
    i_application       = 'SAPDEFAULT'
  IMPORTING
    e_devtype           = v_e_devtype.
st_output_options-tdprinter = v_e_devtype.
st_control_parameters-no_dialog = 'X'.
st_control_parameters-getotf = 'X'.
*.................GET SMARTFORM FUNCTION MODULE NAME.................*
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    formname = c_formname
  IMPORTING
    fm_name  = v_fm_name
  EXCEPTIONS
    no_form  = 1
   no_function_module = 2   
    OTHERS   = 3.
*...........................CALL SMARTFORM............................*
CALL FUNCTION v_fm_name
  EXPORTING
    control_parameters = st_control_parameters
    output_options     = st_output_options
  IMPORTING
    document_output_info  = st_document_output_info
    job_output_info       = st_job_output_info
    job_output_options    = st_job_output_options
  EXCEPTIONS
    formatting_error = 1
    internal_error   = 2
    send_error       = 3
    user_canceled    = 4
    OTHERS           = 5.
*.........................CONVERT TO OTF TO PDF.......................*
  CALL FUNCTION 'CONVERT_OTF_2_PDF'
    IMPORTING
      bin_filesize   = v_bin_filesize
    TABLES
      otf            = st_job_output_info-otfdata
      doctab_archive = it_docs
      lines          = it_lines
    EXCEPTIONS
      err_conv_not_possible  = 1
      err_otf_mc_noendmarker = 2
      OTHERS                            = 3.
 *........................GET THE FILE NAME TO STORE....................*
  CONCATENATE 'smrt' '.pdf' INTO v_name.
  CREATE OBJECT v_guiobj.
  CALL METHOD v_guiobj-&amp;gt;file_save_dialog
    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-&amp;gt;action_cancel.
    EXIT.
  ENDIF.
*..................................DOWNLOAD AS FILE....................*

  MOVE v_fullpath TO v_filename.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      bin_filesize     = v_bin_filesize
      filename         = v_filename
      filetype         = 'BIN'
    TABLES
      data_tab         = it_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.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Aug 2009 08:14:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-04T08:14:53Z</dc:date>
    <item>
      <title>function module to down load the pdf</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-down-load-the-pdf/m-p/6025333#M1348327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai&lt;/P&gt;&lt;P&gt;      I have a program that which converts the printfile file to a PDF and is getting stored in C drive in a separate folder.&lt;/P&gt;&lt;P&gt;How can i down load that pdf file into an internal table.what is the type of the internal table i must declare.&lt;/P&gt;&lt;P&gt;what are the necessary steps to follow.&lt;/P&gt;&lt;P&gt;kindly help me in this out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 06:53:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-down-load-the-pdf/m-p/6025333#M1348327</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T06:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: function module to down load the pdf</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-down-load-the-pdf/m-p/6025334#M1348328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 06:57:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-down-load-the-pdf/m-p/6025334#M1348328</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T06:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: function module to down load the pdf</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-down-load-the-pdf/m-p/6025335#M1348329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use GUI_UPLOAD to upload that file into an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 06:57:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-down-load-the-pdf/m-p/6025335#M1348329</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T06:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: function module to down load the pdf</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-down-load-the-pdf/m-p/6025336#M1348330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to the given code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lv_filetype(10) TYPE c,&lt;/P&gt;&lt;P&gt;        lv_gui_sep TYPE c,&lt;/P&gt;&lt;P&gt;        lv_file_name TYPE string.&lt;/P&gt;&lt;P&gt;  lv_filetype = 'ASC'.(give PDF)&lt;/P&gt;&lt;P&gt;  lv_gui_sep = 'X'.&lt;/P&gt;&lt;P&gt;  lv_file_name = pa_dfile(give the path of the file).&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FM call to upload file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      filename                = lv_file_name&lt;/P&gt;&lt;P&gt;      filetype                = lv_filetype&lt;/P&gt;&lt;P&gt;      has_field_separator     = lv_gui_sep&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      data_tab                = gi_tab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajesh Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 07:53:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-down-load-the-pdf/m-p/6025336#M1348330</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T07:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: function module to down load the pdf</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-down-load-the-pdf/m-p/6025337#M1348331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;and create Spool request for Internal Table or Output table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'RSPO_OPEN_SPOOLREQUEST'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;dest = 'LOCL'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LAYOUT =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NAME =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SUFFIX1 =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SUFFIX2 =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;COPIES =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PRIO =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMMEDIATE_PRINT =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;AUTO_DELETE =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TITLELINE =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;RECEIVER =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DIVISION =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;AUTHORITY =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;POSNAME =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ACTTIME =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LIFETIME = '8'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;APPEND =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;COVERPAGE =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CODEPAGE =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DOCTYPE =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;handle = v_handle&lt;/P&gt;&lt;P&gt;spoolid = gd_spool_nr&lt;/P&gt;&lt;P&gt;rc = v_rc&lt;/P&gt;&lt;P&gt;errmessage = v_errmessage.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;LOOP AT i_mara.&lt;/P&gt;&lt;P&gt;v_text = i_mara-matnr.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'RSPO_WRITE_SPOOLREQUEST'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;handle = v_handle&lt;/P&gt;&lt;P&gt;text = v_text&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LENGTH =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CODEPAGE =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TRUNCATE =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;rc = v_rc&lt;/P&gt;&lt;P&gt;errmessage = v_errmessage&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;handle_not_valid = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2.&lt;/P&gt;&lt;P&gt;IF sy-subrc 0.&lt;/P&gt;&lt;P&gt;MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'RSPO_CLOSE_SPOOLREQUEST'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;handle = v_handle&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;rc = v_rc&lt;/P&gt;&lt;P&gt;errmessage = v_errmessage&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;handle_not_valid = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2.&lt;/P&gt;&lt;P&gt;IF sy-subrc 0.&lt;/P&gt;&lt;P&gt;MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and convert ABAP spool to PDF..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;src_spoolid = gd_spool_nr&lt;/P&gt;&lt;P&gt;no_dialog = c_no&lt;/P&gt;&lt;P&gt;dst_device = c_device&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;pdf_bytecount = gd_bytecount&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;pdf = it_pdf_output&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;err_no_abap_spooljob = 1&lt;/P&gt;&lt;P&gt;err_no_spooljob = 2&lt;/P&gt;&lt;P&gt;err_no_permission = 3&lt;/P&gt;&lt;P&gt;err_conv_not_possible = 4&lt;/P&gt;&lt;P&gt;err_bad_destdevice = 5&lt;/P&gt;&lt;P&gt;user_cancelled = 6&lt;/P&gt;&lt;P&gt;err_spoolerror = 7&lt;/P&gt;&lt;P&gt;err_temseerror = 8&lt;/P&gt;&lt;P&gt;err_btcjob_open_failed = 9&lt;/P&gt;&lt;P&gt;err_btcjob_submit_failed = 10&lt;/P&gt;&lt;P&gt;err_btcjob_close_failed = 11&lt;/P&gt;&lt;P&gt;OTHERS = 12.&lt;/P&gt;&lt;P&gt;CHECK sy-subrc = 0.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and Down load the PDF to desk top..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GUI_DOWNLOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ShreeMohan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 08:08:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-down-load-the-pdf/m-p/6025337#M1348331</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T08:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: function module to down load the pdf</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-down-load-the-pdf/m-p/6025338#M1348332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To Convert Smartform to PDF and store in desktop,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZTEST_NREDDY_PDF
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
REPORT  ZTEST_NREDDY_PDF.
* Internal table declaration
DATA: it_otf      TYPE STANDARD TABLE OF itcoo,
      it_docs     TYPE STANDARD TABLE OF docs,
      it_lines    TYPE STANDARD TABLE OF tline.
* Declaration of local variables.
DATA:
      st_job_output_info       TYPE ssfcrescl,
      st_document_output_info  TYPE ssfcrespd,
      st_job_output_options    TYPE ssfcresop,
      st_output_options        TYPE ssfcompop,
      st_control_parameters    TYPE ssfctrlop,
      v_len_in                 TYPE so_obj_len,
      v_language               TYPE sflangu VALUE 'E',
      v_e_devtype              TYPE rspoptype,
      v_bin_filesize           TYPE i,
      v_name                   TYPE string,
      v_path                   TYPE string,
      v_fullpath               TYPE string,
      v_filter                 TYPE string,
      v_uact                   TYPE i,
      v_guiobj                 TYPE REF TO cl_gui_frontend_services,
      v_filename               TYPE string,
      v_fm_name                TYPE rs38l_fnam.
CONSTANTS c_formname           TYPE tdsfname VALUE 'ZTEST'.
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
  EXPORTING
    i_language          = v_language
    i_application       = 'SAPDEFAULT'
  IMPORTING
    e_devtype           = v_e_devtype.
st_output_options-tdprinter = v_e_devtype.
st_control_parameters-no_dialog = 'X'.
st_control_parameters-getotf = 'X'.
*.................GET SMARTFORM FUNCTION MODULE NAME.................*
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    formname = c_formname
  IMPORTING
    fm_name  = v_fm_name
  EXCEPTIONS
    no_form  = 1
   no_function_module = 2   
    OTHERS   = 3.
*...........................CALL SMARTFORM............................*
CALL FUNCTION v_fm_name
  EXPORTING
    control_parameters = st_control_parameters
    output_options     = st_output_options
  IMPORTING
    document_output_info  = st_document_output_info
    job_output_info       = st_job_output_info
    job_output_options    = st_job_output_options
  EXCEPTIONS
    formatting_error = 1
    internal_error   = 2
    send_error       = 3
    user_canceled    = 4
    OTHERS           = 5.
*.........................CONVERT TO OTF TO PDF.......................*
  CALL FUNCTION 'CONVERT_OTF_2_PDF'
    IMPORTING
      bin_filesize   = v_bin_filesize
    TABLES
      otf            = st_job_output_info-otfdata
      doctab_archive = it_docs
      lines          = it_lines
    EXCEPTIONS
      err_conv_not_possible  = 1
      err_otf_mc_noendmarker = 2
      OTHERS                            = 3.
 *........................GET THE FILE NAME TO STORE....................*
  CONCATENATE 'smrt' '.pdf' INTO v_name.
  CREATE OBJECT v_guiobj.
  CALL METHOD v_guiobj-&amp;gt;file_save_dialog
    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-&amp;gt;action_cancel.
    EXIT.
  ENDIF.
*..................................DOWNLOAD AS FILE....................*

  MOVE v_fullpath TO v_filename.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      bin_filesize     = v_bin_filesize
      filename         = v_filename
      filetype         = 'BIN'
    TABLES
      data_tab         = it_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.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 08:14:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-down-load-the-pdf/m-p/6025338#M1348332</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T08:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: function module to down load the pdf</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-down-load-the-pdf/m-p/6025339#M1348333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;       When calling the function module generated by smart form we will pass the internal table name to get the desired output. But to save it as a PDF format &lt;/P&gt;&lt;P&gt;     we have to export certain parameters to the generated function module.&lt;/P&gt;&lt;P&gt;       They are&lt;/P&gt;&lt;P&gt;a)	Control_Parameters: To access the OTF table, we have to pass &lt;/P&gt;&lt;P&gt;           get-OTF =u2019Xu2019.&lt;/P&gt;&lt;P&gt;b)	Output_options: To print settings. For this we have to pass tddest = 'LP01u2019.&lt;/P&gt;&lt;P&gt;       We have to import following parameters:&lt;/P&gt;&lt;P&gt;          They are&lt;/P&gt;&lt;P&gt;a)	JOB_Ouput_Info:  To import the table in the OTF format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        Now we can convert the OTF table into PDF format using function module 'Convert_OTF'. And we can save it using 'GUI_DOWNLOAD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Pavan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 08:24:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-down-load-the-pdf/m-p/6025339#M1348333</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T08:24:06Z</dc:date>
    </item>
  </channel>
</rss>

