<?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: Convert SmartForm to PDF issues in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-smartform-to-pdf-issues/m-p/3748536#M901947</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot!  It is in the  st_control_parameters.  I forgot to copy that portion of the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 May 2008 18:48:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-07T18:48:25Z</dc:date>
    <item>
      <title>Convert SmartForm to PDF issues</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-smartform-to-pdf-issues/m-p/3748534#M901945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the following code to convert a SmartForm into PDF.  I got a lot of the code from a Wiki but I have a few issues with it.  The first is that I do not want to display the SmartForm to the user; I want it saved, as a PDF, imediatly.  My other issue is that I get an error when it calls the FM 'CONVERT_OTF_2_PDF'.  The error says:  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'OTF end command // missing in OTF data'.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What does that error mean and how do I fix it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: d_fname TYPE rs38l_fnam,
      d_object_id TYPE sysuuid_c,
      d_col_name TYPE string.


DATA: it_otf   TYPE STANDARD TABLE OF itcoo,
      it_docs  TYPE STANDARD TABLE OF docs,
      it_lines TYPE STANDARD TABLE OF tline,
      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_FUNCTION_MODULE_NAME'
EXPORTING
  formname                 = 'ZAS_SMF_CFOLDER_RFI'
*   VARIANT                  = ' '
*   DIRECT_CALL              = ' '
IMPORTING
  fm_name                  = d_fname
* EXCEPTIONS
*   NO_FORM                  = 1
*   NO_FUNCTION_MODULE       = 2
*   OTHERS                   = 3
  .
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

CALL FUNCTION d_fname
EXPORTING
*     ARCHIVE_INDEX              =
*     ARCHIVE_INDEX_TAB          =
*     ARCHIVE_PARAMETERS         =
  control_parameters         = st_control_parameters
*     MAIL_APPL_OBJ              =
*     MAIL_RECIPIENT             =
*     MAIL_SENDER                =
  output_options             = st_output_options
  user_settings              = 'X'
  i_object                   = d_object_id
  i_col_name                 = d_col_name
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
  .
IF sy-subrc = 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

*.........................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.
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

*..................................DOWNLOAD AS FILE....................*
v_filename = 'C:/TESTPDF.PDF'.

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.
IF sy-subrc &amp;lt;&amp;gt; 0.
*     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&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;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2008 18:40:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-smartform-to-pdf-issues/m-p/3748534#M901945</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-07T18:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SmartForm to PDF issues</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-smartform-to-pdf-issues/m-p/3748535#M901946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when calling the function module for the smartform, you will have to add the get_otf parameter of one of your exporting parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if this is the st_control_parameters or the st_output_options parameter. Look for field get_otf in one of these parameters and mark it like 'X'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2008 18:44:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-smartform-to-pdf-issues/m-p/3748535#M901946</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2008-05-07T18:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Convert SmartForm to PDF issues</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-smartform-to-pdf-issues/m-p/3748536#M901947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot!  It is in the  st_control_parameters.  I forgot to copy that portion of the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2008 18:48:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-smartform-to-pdf-issues/m-p/3748536#M901947</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-07T18:48:25Z</dc:date>
    </item>
  </channel>
</rss>

