<?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 End the program execution inside a User exit in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/end-the-program-execution-inside-a-user-exit/m-p/4959424#M1156207</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I am using a FM in a User exit. I want to give an error message if the FM gives a sy-subrc NE 0 and then the program should stop working.&lt;/P&gt;&lt;P&gt;I am using tcode COR1 to create a process order.Once the program reaches that FM .if sy-subrc &amp;lt;&amp;gt; 0 &lt;/P&gt;&lt;P&gt;then it reaches that message but neither it gives an error message output nor ends the program execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following  FM is used inside the User exit.CANCELLED is the exception in that user exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHILE sy-subrc &amp;lt;&amp;gt; 0 .&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'ENQUEUE_EZ_0901_WM_0001'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        mode_z09_2_3_2_1__001 = 'E'&lt;/P&gt;&lt;P&gt;        mandt                 = sy-mandt&lt;/P&gt;&lt;P&gt;        nryear                = l-nryear&lt;/P&gt;&lt;P&gt;        z_nrmonth             = l-nrmonth&lt;/P&gt;&lt;P&gt;        x_nryear              = ' '&lt;/P&gt;&lt;P&gt;        x_z_nrmonth           = ' '&lt;/P&gt;&lt;P&gt;        _scope                = '2'&lt;/P&gt;&lt;P&gt;        _wait                 = 'X'           &lt;/P&gt;&lt;P&gt;        _collect              = ' '&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        foreign_lock          = 1&lt;/P&gt;&lt;P&gt;        system_failure        = 2&lt;/P&gt;&lt;P&gt;        OTHERS                = 3.&lt;/P&gt;&lt;P&gt;    IF sy-index &amp;gt; 100 AND sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE e398(00) WITH 'Please run this program again' RAISING cancelled.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDWHILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please guide me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Dec 2008 09:06:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-29T09:06:01Z</dc:date>
    <item>
      <title>End the program execution inside a User exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/end-the-program-execution-inside-a-user-exit/m-p/4959424#M1156207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I am using a FM in a User exit. I want to give an error message if the FM gives a sy-subrc NE 0 and then the program should stop working.&lt;/P&gt;&lt;P&gt;I am using tcode COR1 to create a process order.Once the program reaches that FM .if sy-subrc &amp;lt;&amp;gt; 0 &lt;/P&gt;&lt;P&gt;then it reaches that message but neither it gives an error message output nor ends the program execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following  FM is used inside the User exit.CANCELLED is the exception in that user exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHILE sy-subrc &amp;lt;&amp;gt; 0 .&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'ENQUEUE_EZ_0901_WM_0001'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        mode_z09_2_3_2_1__001 = 'E'&lt;/P&gt;&lt;P&gt;        mandt                 = sy-mandt&lt;/P&gt;&lt;P&gt;        nryear                = l-nryear&lt;/P&gt;&lt;P&gt;        z_nrmonth             = l-nrmonth&lt;/P&gt;&lt;P&gt;        x_nryear              = ' '&lt;/P&gt;&lt;P&gt;        x_z_nrmonth           = ' '&lt;/P&gt;&lt;P&gt;        _scope                = '2'&lt;/P&gt;&lt;P&gt;        _wait                 = 'X'           &lt;/P&gt;&lt;P&gt;        _collect              = ' '&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        foreign_lock          = 1&lt;/P&gt;&lt;P&gt;        system_failure        = 2&lt;/P&gt;&lt;P&gt;        OTHERS                = 3.&lt;/P&gt;&lt;P&gt;    IF sy-index &amp;gt; 100 AND sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE e398(00) WITH 'Please run this program again' RAISING cancelled.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDWHILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please guide me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 09:06:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/end-the-program-execution-inside-a-user-exit/m-p/4959424#M1156207</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-29T09:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: End the program execution inside a User exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/end-the-program-execution-inside-a-user-exit/m-p/4959425#M1156208</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;after the exit statement try " leave to screen 0" and check wether it helps u to pull ot from the transaction code .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 09:12:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/end-the-program-execution-inside-a-user-exit/m-p/4959425#M1156208</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-29T09:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: End the program execution inside a User exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/end-the-program-execution-inside-a-user-exit/m-p/4959426#M1156209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use &lt;STRONG&gt;LEAVE PROGRAM&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 09:15:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/end-the-program-execution-inside-a-user-exit/m-p/4959426#M1156209</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-29T09:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: End the program execution inside a User exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/end-the-program-execution-inside-a-user-exit/m-p/4959427#M1156210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Raise exception with error message, the program automatically stop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 09:16:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/end-the-program-execution-inside-a-user-exit/m-p/4959427#M1156210</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-29T09:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: End the program execution inside a User exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/end-the-program-execution-inside-a-user-exit/m-p/4959428#M1156211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check that the condition that you have given for the message is true when you want to show the message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e. sy-index should be greater than 100 also sy-subrc value should be '0' i.e. FM executed successfully, when both the condition are true then only you will be able to show the message that you want to show.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to display the message as &lt;EM&gt;Message 'Executed Successfully' type 'I'.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jayant.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 09:18:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/end-the-program-execution-inside-a-user-exit/m-p/4959428#M1156211</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-29T09:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: End the program execution inside a User exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/end-the-program-execution-inside-a-user-exit/m-p/4959429#M1156212</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;Try removing the raising cancelled and run.&lt;/P&gt;&lt;P&gt;IF sy-index &amp;gt; 100 AND sy-subrc 0.&lt;/P&gt;&lt;P&gt;MESSAGE e398(00) WITH 'Please run this program again'.&lt;/P&gt;&lt;P&gt;Leave list-processing.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Dec 2008 09:22:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/end-the-program-execution-inside-a-user-exit/m-p/4959429#M1156212</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2008-12-29T09:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: End the program execution inside a User exit</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/end-the-program-execution-inside-a-user-exit/m-p/4959430#M1156213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks a lot for your replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 08:44:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/end-the-program-execution-inside-a-user-exit/m-p/4959430#M1156213</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T08:44:27Z</dc:date>
    </item>
  </channel>
</rss>

