<?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 Regarding subroutine (Form-EndForm) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-subroutine-form-endform/m-p/8251266#M1631119</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do I trigger a Subroutine ( It creates a new ticket/insurance claim number/Invoice number) only when print command is given and not when print preview is given so that un-necessarily new ticket/claim/invoice NUMBERS are not generated?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 01 Oct 2011 03:11:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-10-01T03:11:18Z</dc:date>
    <item>
      <title>Regarding subroutine (Form-EndForm)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-subroutine-form-endform/m-p/8251266#M1631119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do I trigger a Subroutine ( It creates a new ticket/insurance claim number/Invoice number) only when print command is given and not when print preview is given so that un-necessarily new ticket/claim/invoice NUMBERS are not generated?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Oct 2011 03:11:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-subroutine-form-endform/m-p/8251266#M1631119</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-01T03:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding subroutine (Form-EndForm)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-subroutine-form-endform/m-p/8251267#M1631120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it is a script or the smartform ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the sap script you can call the perform as shown below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could make a condition to call the below subroutine in sap script window editor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:  if sy-ucomm = 'PRINT '.&lt;/P&gt;&lt;P&gt;                  perform  TABLES fp_it_intab STRUCTURE itcsy&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fp_it_outtab STRUCTURE itcsy.&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;&lt;/P&gt;&lt;P&gt;Endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Please let me know if you want the fuction code for print command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ashwin Kumar Chitram on Oct 1, 2011 7:21 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Oct 2011 05:20:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-subroutine-form-endform/m-p/8251267#M1631120</guid>
      <dc:creator>former_member212854</dc:creator>
      <dc:date>2011-10-01T05:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding subroutine (Form-EndForm)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-subroutine-form-endform/m-p/8251268#M1631121</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;Are your commands PRINT and PRINT PREVIEW, buttons / check boxes / radio buttons ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

* For Radio Buttons and Check Boxes.
  IF p_prntpr = 'X'.
    PERFORM print_preview.
  ELSEIF p_print = 'X'.
    PERFORM print.
  ENDIF.

* For Buttons.
  CASE sy-ucomm.
    WHEN 'PRINT_PR'.
      PERFORM print_preview.
    WHEN 'PRINT'.
      PERFORM print.
  ENDCASE.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Danish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Oct 2011 06:50:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-subroutine-form-endform/m-p/8251268#M1631121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-01T06:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding subroutine (Form-EndForm)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-subroutine-form-endform/m-p/8251269#M1631122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually what I'm doing is there is a screen where you need to enter few values and press F8 for processing then the pop-up where we need to give the printer name etc comes up, in this pop-up in bottom right corner we have few buttons "PRINT", "PRINT-PREVIEW" etc. So If I press the "PRINT PREVIEW" button my sub-routine should NOT get executed. If I press the "PRINT" button my subroutine should get executed. Is there a solution for this situation?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Oct 2011 07:37:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-subroutine-form-endform/m-p/8251269#M1631122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-01T07:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding subroutine (Form-EndForm)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-subroutine-form-endform/m-p/8251270#M1631123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A method you can adopt is to put a code line inside the smartform in such a way that :&lt;/P&gt;&lt;P&gt;Check for JOB_OUTPUT_OPTIONS-TDPREVIEW ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if TDPREVIEW is 'X'.   "X if Print preview is selected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"do ur coding here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else .&lt;/P&gt;&lt;P&gt;"execute alternate code..."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will meet ur requirement...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Oct 2011 08:37:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-subroutine-form-endform/m-p/8251270#M1631123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-02T08:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding subroutine (Form-EndForm)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-subroutine-form-endform/m-p/8251271#M1631124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My form is a Adobe form output. How will the solution change now. The adobe form has been designed in SFP and is being called from Module pool program. The input is given in the screen and F8 is used to process and then the PRINT pop-up comes up for the printer name etc. here if PRINT PREVIEW is selected my subroutine should not get process and if PRINT is selected my sub-routine shouls get processed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Oct 2011 08:58:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-subroutine-form-endform/m-p/8251271#M1631124</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-02T08:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding subroutine (Form-EndForm)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-subroutine-form-endform/m-p/8251272#M1631125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have found out the way to capture the sy-ucomm value given back from default print dialogue pop-up. After the functional module 'FP JOB OPEN' is called the default print dialogue box will appear, you might select "print" or "print preview", after either of this is selected and before the adobe form is called" check for sy-ucomm value, and trigger your sub-routine accordingly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2011 05:16:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-subroutine-form-endform/m-p/8251272#M1631125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-17T05:16:27Z</dc:date>
    </item>
  </channel>
</rss>

