<?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: Print several Smart Forms within a loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/print-several-smart-forms-within-a-loop/m-p/1407326#M196499</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alejandro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The pop up window can be suppressed like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: ctrl_param type ssfctrlop,&lt;/P&gt;&lt;P&gt;out_option type ssfcompop,&lt;/P&gt;&lt;P&gt;fm_name type rs38l_fnam.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ctrl_param-preview = &amp;lt;i&amp;gt;space&amp;lt;/i&amp;gt;.&lt;/P&gt;&lt;P&gt;out_option-tddest = 'LP01'. "name of the printer&lt;/P&gt;&lt;P&gt;ctrl_param-no_dialog = 'X'.&amp;lt;/b&amp;gt;&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 = gv_form&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;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;call function fm_name&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;control_parameters = ctrl_param&lt;/P&gt;&lt;P&gt;output_options = out_option&lt;/P&gt;&lt;P&gt;user_settings = space&amp;lt;/b&amp;gt;&lt;/P&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;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&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;&amp;lt;b&amp;gt;Close the thread once the problem is resolved.&amp;lt;/b&amp;gt;&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>Fri, 21 Jul 2006 14:51:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-21T14:51:36Z</dc:date>
    <item>
      <title>Print several Smart Forms within a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/print-several-smart-forms-within-a-loop/m-p/1407324#M196497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following situation: I need to print a form several times depending on the quantity of customers the user selects, being each customer a different form. Now, I have implemented this correctly, how ever, each time the smart form function is called within the loop the system displays the printing popup window (the one which asks for print preview, print, etc). The user doesn't want this window to be displayed every pass of the loop but up to the end of the loop, so the window is displayed just once for the set of forms. Also they want to be able to preview all the smart forms at once. &lt;/P&gt;&lt;P&gt;Is this possible? Your help on this will be very appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A very simplified version of the case would be the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   DO 100 TIMES.&lt;/P&gt;&lt;P&gt;     PERFORM display_cust_ar.&lt;/P&gt;&lt;P&gt;   ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM display_cust_ar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: cf_retcode LIKE sy-subrc.&lt;/P&gt;&lt;P&gt;  DATA: lf_fm_name            TYPE rs38l_fnam.&lt;/P&gt;&lt;P&gt;  DATA: lf_formname           TYPE tdsfname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lf_formname = 'NAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT t_line BY kunnr.&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           = lf_formname&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      fm_name            = lf_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;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  error handling&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    cf_retcode = sy-subrc.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION lf_fm_name&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      p_multiple_lines = i_multiple_clients&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      p_header         = t_header&lt;/P&gt;&lt;P&gt;      p_lines          = t_line_final2&lt;/P&gt;&lt;P&gt;      p_total          = t_total_final&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2006 14:45:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/print-several-smart-forms-within-a-loop/m-p/1407324#M196497</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-21T14:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Print several Smart Forms within a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/print-several-smart-forms-within-a-loop/m-p/1407325#M196498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to set and send the control parameters to your form.&lt;/P&gt;&lt;P&gt;CONTROL_PARAMETERS TYPE SSFCTRLOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set the No_Dialog to 'X' and Preview to space.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2006 14:48:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/print-several-smart-forms-within-a-loop/m-p/1407325#M196498</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-21T14:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Print several Smart Forms within a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/print-several-smart-forms-within-a-loop/m-p/1407326#M196499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alejandro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The pop up window can be suppressed like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: ctrl_param type ssfctrlop,&lt;/P&gt;&lt;P&gt;out_option type ssfcompop,&lt;/P&gt;&lt;P&gt;fm_name type rs38l_fnam.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ctrl_param-preview = &amp;lt;i&amp;gt;space&amp;lt;/i&amp;gt;.&lt;/P&gt;&lt;P&gt;out_option-tddest = 'LP01'. "name of the printer&lt;/P&gt;&lt;P&gt;ctrl_param-no_dialog = 'X'.&amp;lt;/b&amp;gt;&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 = gv_form&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;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;call function fm_name&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;control_parameters = ctrl_param&lt;/P&gt;&lt;P&gt;output_options = out_option&lt;/P&gt;&lt;P&gt;user_settings = space&amp;lt;/b&amp;gt;&lt;/P&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;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&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;&amp;lt;b&amp;gt;Close the thread once the problem is resolved.&amp;lt;/b&amp;gt;&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>Fri, 21 Jul 2006 14:51:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/print-several-smart-forms-within-a-loop/m-p/1407326#M196499</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-21T14:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Print several Smart Forms within a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/print-several-smart-forms-within-a-loop/m-p/1407327#M196500</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;data: ls_composer_param     type ssfcompop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if count &amp;gt; 99&lt;/P&gt;&lt;P&gt;ls_composer_param-TDNOPREV = 'X' .&lt;/P&gt;&lt;P&gt;endif .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function lf_fm_name &lt;/P&gt;&lt;P&gt;exporting &lt;/P&gt;&lt;P&gt;output_options = ls_composer_param&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;try this, I guess this should work .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Varun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2006 14:55:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/print-several-smart-forms-within-a-loop/m-p/1407327#M196500</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-21T14:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Print several Smart Forms within a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/print-several-smart-forms-within-a-loop/m-p/1407328#M196501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alejandro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Is your problem solved....?&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you want to display the pop-up only once for entire set, you can do like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;declare a variable called count.&lt;/P&gt;&lt;P&gt;declare another variable for user settings (say set).&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;Outside the loop&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ctrl_param-preview = space.&lt;/P&gt;&lt;P&gt;out_option-tddest = 'LP01'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within the loop, check if the count is equal to 1. &lt;/P&gt;&lt;P&gt;Then &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;put &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ctrl_param-no_dialog = space.&lt;/P&gt;&lt;P&gt;set = 'X'&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ctrl_param-no_dialog = 'X'.&lt;/P&gt;&lt;P&gt;set = space&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now call the FM SSF_FUNCTION_MODULE_NAME and the generated Function Module&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;with user_settings = set&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this should solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Close the thread once the  problem is solved.&amp;lt;/b&amp;gt;&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>Fri, 21 Jul 2006 15:28:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/print-several-smart-forms-within-a-loop/m-p/1407328#M196501</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-21T15:28:32Z</dc:date>
    </item>
  </channel>
</rss>

