<?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: Smartform problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-problem/m-p/1362708#M179850</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mauro,&lt;/P&gt;&lt;P&gt; Use this &lt;/P&gt;&lt;P&gt;  DATA : g_fm_name TYPE rs38l_fnam,&lt;/P&gt;&lt;P&gt;         g_output  TYPE   ssfcompop,&lt;/P&gt;&lt;P&gt;         g_control TYPE ssfctrlop,&lt;/P&gt;&lt;P&gt;         g_form TYPE tdsfname VALUE 'ZPRINT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      formname           = g_form&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      fm_name            = g_fm_name&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      no_form            = 1&lt;/P&gt;&lt;P&gt;      no_function_module = 2&lt;/P&gt;&lt;P&gt;      OTHERS             = 3.&lt;/P&gt;&lt;P&gt;  g_control-no_dialog = 'X'.&lt;/P&gt;&lt;P&gt;  g_output-tddest = p_device.&lt;/P&gt;&lt;P&gt;  g_output-tdnewid = 'X'.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION g_fm_name&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        control_parameters = g_control&lt;/P&gt;&lt;P&gt;        output_options     = g_output&lt;/P&gt;&lt;P&gt;        user_settings      = ' '&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        formatting_error   = 1&lt;/P&gt;&lt;P&gt;        internal_error     = 2&lt;/P&gt;&lt;P&gt;        send_error         = 3&lt;/P&gt;&lt;P&gt;        user_canceled      = 4&lt;/P&gt;&lt;P&gt;        OTHERS             = 5.&lt;/P&gt;&lt;P&gt;    CLEAR g_output-tdnewid .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 May 2006 06:48:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-05-30T06:48:43Z</dc:date>
    <item>
      <title>Smartform problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-problem/m-p/1362704#M179846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a smartform that will be printed severals times inside a loop, now I want to avoid the print dialog and print preview, and depending of user options, I want to define the device and if the user wants to print inmediatly or just generate a spool order. but for some reason I can't do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname           = 'Z_MY_FORM'
    IMPORTING
      fm_name            = l_fm_name
    EXCEPTIONS
      no_form            = 1
      no_function_module = 2
      OTHERS             = 3.

    control-no_dialog = 'X'.
    control-no_open   = 'X'.
    control-no_close  = 'X'.

    output_options-tdnewid  = 'X'.
    output_options-tdimmed  = p_device.
    output_options-tddest   = p_printNow.

    CALL FUNCTION 'SSF_OPEN'
      EXPORTING
        control_parameters = control
        output_options     = output_options
      EXCEPTIONS
        formatting_error   = 1
        internal_error     = 2
        send_error         = 3
        user_canceled      = 4
        OTHERS             = 5.

   LOOP AT it_table.
    CALL FUNCTION l_fm_name
      EXPORTING
        control_parameters = control
        swnes              = it_table-swnes
        laufd              = it_table-laufd
        vblnr              = it_table-vblnr
        lifnr              = it_table-lifnr
        word               = it_table-word
        waers              = it_table-waers
      EXCEPTIONS
        formatting_error   = 1
        internal_error     = 2
        send_error         = 3
        user_canceled      = 4
        OTHERS             = 5.
   ENDLOOP.

   CALL FUNCTION 'SSF_CLOSE'
     EXCEPTIONS
       formatting_error = 1
       internal_error   = 2
       send_error       = 3
       OTHERS           = 4.

    CALL FUNCTION 'SSF_READ_ERRORS'
      IMPORTING
        errortab = errtab[].
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every time I try to call the FM l_fm_name (the smartform FM) without the print preview option in the control structure I have a sy-subrc return of 3 (Send error) and don't know why...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas will be welcome and rewarded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 May 2006 20:46:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-problem/m-p/1362704#M179846</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-29T20:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Smartform problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-problem/m-p/1362705#M179847</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;Can you try removing the SSF_OPEN / SSF_CLOSE functions?&lt;/P&gt;&lt;P&gt;Directly pass the control parameters and output options to the SMART form function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note : Please mark the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2006 00:12:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-problem/m-p/1362705#M179847</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-30T00:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Smartform problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-problem/m-p/1362706#M179848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mauro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can avoid the Print dialog and Print Preview Window by modifying the control parameters .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just check this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  YSHAIL_SMARTFORM1                       .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: cparam type SSFCTRLOP.&lt;/P&gt;&lt;P&gt;data: outop type SSFCOMPOP.&lt;/P&gt;&lt;P&gt;data: fm_name type RS38L_FNAM.&lt;/P&gt;&lt;P&gt;data: itab type table of zshail_t1 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    formname                 = 'YSHAIL_SFORM2'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  VARIANT                  = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DIRECT_CALL              = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   FM_NAME                  = fm_name&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   NO_FORM                  = 1&lt;/P&gt;&lt;P&gt;   NO_FUNCTION_MODULE       = 2&lt;/P&gt;&lt;P&gt;   OTHERS                   = 3&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from zshail_t1 into table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CPARAM-PREVIEW = 'X'. &lt;/P&gt;&lt;P&gt;OUTOP-TDDEST = 'LP01'. "device name"&lt;/P&gt;&lt;P&gt;CPARAM-NO_DIALOG = 'X'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION fm_name&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ARCHIVE_INDEX              =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ARCHIVE_INDEX_TAB          =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  ARCHIVE_PARAMETERS         =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;lt;b&amp;gt; CONTROL_PARAMETERS         = cparam&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  MAIL_APPL_OBJ              =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  MAIL_RECIPIENT             =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  MAIL_SENDER                =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;lt;b&amp;gt; OUTPUT_OPTIONS             = OUTOP&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; USER_SETTINGS              = SPACE&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DOCUMENT_OUTPUT_INFO       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  JOB_OUTPUT_INFO            =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  JOB_OUTPUT_OPTIONS         =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    itab                       = itab[]&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   FORMATTING_ERROR           = 1&lt;/P&gt;&lt;P&gt;   INTERNAL_ERROR             = 2&lt;/P&gt;&lt;P&gt;   SEND_ERROR                 = 3&lt;/P&gt;&lt;P&gt;   USER_CANCELED              = 4&lt;/P&gt;&lt;P&gt;   OTHERS                     = 5&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;SP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2006 03:20:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-problem/m-p/1362706#M179848</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-30T03:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Smartform problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-problem/m-p/1362707#M179849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mauro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;1&amp;lt;/b&amp;gt;.You need to remove SSF_OPEN and SSF_CLOSE.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;2&amp;lt;/b&amp;gt;.Define 2 variables &lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;num_1  TYPE i,&lt;/P&gt;&lt;P&gt;num_2  TYPE sy-tabix. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE it_table LINES num_1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_table.&lt;/P&gt;&lt;P&gt;    num_2 = sy-tabix.&lt;/P&gt;&lt;P&gt;    CASE num_2.&lt;/P&gt;&lt;P&gt;      WHEN 1.&lt;/P&gt;&lt;P&gt;        control_parameters-no_open   = ' '.&lt;/P&gt;&lt;P&gt;        control_parameters-no_close  = 'X'.&lt;/P&gt;&lt;P&gt;      WHEN num_1.&lt;/P&gt;&lt;P&gt;        control_parameters-no_open   = 'X'.&lt;/P&gt;&lt;P&gt;        control_parameters-no_close  = space.&lt;/P&gt;&lt;P&gt;      WHEN OTHERS.&lt;/P&gt;&lt;P&gt;        control_parameters-no_open   = 'X'.&lt;/P&gt;&lt;P&gt;        control_parameters-no_close  = 'X'.&lt;/P&gt;&lt;P&gt;    ENDCASE.&lt;/P&gt;&lt;P&gt;    IF num_1 = 1.&lt;/P&gt;&lt;P&gt;      CLEAR: control_parameters.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  control_parameters-langu     = sy-langu.&lt;/P&gt;&lt;P&gt;  control_parameters-no_dialog = 'X'.&lt;/P&gt;&lt;P&gt;  control_parameters-preview   = 'X'.&amp;lt;b&amp;gt;with print priview&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;or&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;  control_parameters-preview   = 'X'.&amp;lt;b&amp;gt;Without print priview.This is direct printing&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CALL FUNCTION l_fm_name &amp;lt;/b&amp;gt;   &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;EXPORTING&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;control_parameters = control_parameters&lt;/P&gt;&lt;P&gt;swnes             = it_table-swnes              laufd             = it_table-laufd        vblnr             = it_table-vblnr        lifnr             = it_table-lifnr        word              = it_table-word        waers             = it_table-waers      &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;EXCEPTIONS &amp;lt;/b&amp;gt;       &lt;/P&gt;&lt;P&gt;formatting_error   = 1&lt;/P&gt;&lt;P&gt;internal_error     = 2&lt;/P&gt;&lt;P&gt;send_error         = 3        &lt;/P&gt;&lt;P&gt;user_canceled      = 4        &lt;/P&gt;&lt;P&gt;OTHERS             = 5.  &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;It solves ur problem.&lt;/P&gt;&lt;P&gt;Let me know ,if u have any problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Thanks.&lt;/P&gt;&lt;P&gt;Venkat.O&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2006 05:49:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-problem/m-p/1362707#M179849</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2006-05-30T05:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Smartform problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-problem/m-p/1362708#M179850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mauro,&lt;/P&gt;&lt;P&gt; Use this &lt;/P&gt;&lt;P&gt;  DATA : g_fm_name TYPE rs38l_fnam,&lt;/P&gt;&lt;P&gt;         g_output  TYPE   ssfcompop,&lt;/P&gt;&lt;P&gt;         g_control TYPE ssfctrlop,&lt;/P&gt;&lt;P&gt;         g_form TYPE tdsfname VALUE 'ZPRINT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      formname           = g_form&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      fm_name            = g_fm_name&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      no_form            = 1&lt;/P&gt;&lt;P&gt;      no_function_module = 2&lt;/P&gt;&lt;P&gt;      OTHERS             = 3.&lt;/P&gt;&lt;P&gt;  g_control-no_dialog = 'X'.&lt;/P&gt;&lt;P&gt;  g_output-tddest = p_device.&lt;/P&gt;&lt;P&gt;  g_output-tdnewid = 'X'.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION g_fm_name&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        control_parameters = g_control&lt;/P&gt;&lt;P&gt;        output_options     = g_output&lt;/P&gt;&lt;P&gt;        user_settings      = ' '&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        formatting_error   = 1&lt;/P&gt;&lt;P&gt;        internal_error     = 2&lt;/P&gt;&lt;P&gt;        send_error         = 3&lt;/P&gt;&lt;P&gt;        user_canceled      = 4&lt;/P&gt;&lt;P&gt;        OTHERS             = 5.&lt;/P&gt;&lt;P&gt;    CLEAR g_output-tdnewid .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2006 06:48:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-problem/m-p/1362708#M179850</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-30T06:48:43Z</dc:date>
    </item>
  </channel>
</rss>

