<?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: How to add exceptions to function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190528#M1201307</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;You can define your own exceptions and inside the source code.... use RAISE statement to show the message without going into DUMP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;r&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Feb 2009 12:06:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-25T12:06:05Z</dc:date>
    <item>
      <title>How to add exceptions to function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190522#M1201301</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;&lt;/P&gt;&lt;P&gt;I have a query , how to add exceptions to a standard function module when there are no exceptions provided by default . Also please let me know by adding exceptions can we just throw a message and will we be able to prevent the program from going into dump.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 10:12:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190522#M1201301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-25T10:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to add exceptions to function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190523#M1201302</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;It is not possible to add exceptions to std FM without raising for an OSS message. After getting the key for editing the FM u can add the Exceptions and can give some messages in the program after a sy-subrc check. But this is not recommended as this FM might be used in different programs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keerthi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Keerthy K on Feb 25, 2009 11:23 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 10:22:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190523#M1201302</guid>
      <dc:creator>keerthy_k</dc:creator>
      <dc:date>2009-02-25T10:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to add exceptions to function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190524#M1201303</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;U can use Return code to avoid Dumb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use PROCESS_MESS_GET_RETURN_CODE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or Search &lt;STRONG&gt;RETURN&lt;/STRONG&gt;CODE* in SE37 find suitable FM to ur requirement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 10:23:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190524#M1201303</guid>
      <dc:creator>naveen_kumar116</dc:creator>
      <dc:date>2009-02-25T10:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to add exceptions to function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190525#M1201304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Balaji,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As this is standard function module, I think you can't change its code, which will be required to raise some exceptions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for the second question if you use in FM such statement&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
RAISE exc.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then after calling this FM you need to handle this exceptions, otherwise system will dump out.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL FM '....'
...
EXCEPTIONS
    exc = 2.

if sy-subrc &amp;lt;&amp;gt; 2.
   MESSAGE ....  'Exception raised'.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to handle it inside the FM, you need to write like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MESSAGE .... RAISING exc.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this when exception is raised system will end up the FM and the result is stored in &lt;STRONG&gt;sy&lt;/STRONG&gt; structure&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL FM '...'
...
EXCEPTIONS
      exc = 2.
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;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 10:26:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190525#M1201304</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-02-25T10:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to add exceptions to function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190526#M1201305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naveen ,  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had a look at the function module " PROCESS_MESS_GET_RETURN_CODE " but not sure how to use that to raise an exception , can you please help me with it , do you have any sample code showing the use of this FM . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 11:10:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190526#M1201305</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-25T11:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to add exceptions to function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190527#M1201306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As in previous answers, I do not advise you to change a strandard function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can in an exit / Badi send an error message, the calling programs must intercept the exception ERROR_MESSAGE to avoid any dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 12:01:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190527#M1201306</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2009-02-25T12:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to add exceptions to function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190528#M1201307</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;You can define your own exceptions and inside the source code.... use RAISE statement to show the message without going into DUMP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;r&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Feb 2009 12:06:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190528#M1201307</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-25T12:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to add exceptions to function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190529#M1201308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 14:37:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-add-exceptions-to-function-module/m-p/5190529#M1201308</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-27T14:37:12Z</dc:date>
    </item>
  </channel>
</rss>

