<?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 exception in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception/m-p/3098224#M735104</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can anybody tell about the exception handling in abap and its importance in case of function modules.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Dec 2007 13:15:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-05T13:15:00Z</dc:date>
    <item>
      <title>exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception/m-p/3098224#M735104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can anybody tell about the exception handling in abap and its importance in case of function modules.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2007 13:15:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception/m-p/3098224#M735104</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-05T13:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception/m-p/3098225#M735105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... EXCEPTIONS except1 = rc1 ...exceptn = rcn &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;EXCEPTIONS lists the exceptions to be handled by the calling program itself. At the end of the exception list, you can use OTHERS to refer to all the remaining exceptions. &lt;/P&gt;&lt;P&gt;If one of the listed exceptions occurs, SY-SUBRC is set to the appropriate value rc (a numeric literal!) and control passes back to the calling program. By specifying a return code, you can divided the exceptions into classes. With the second form, without "=rc", SY-SUBRC is set to a value other than 0 if an exception occurs. &lt;/P&gt;&lt;P&gt;If the function module triggers an exception (with the statements RAISE and MESSAGE ... RAISING) and the exception is not to be handled by the calling program itself, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RAISE terminates the program with a runtime error; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE ... RAISING outputs the message. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;The following EXCEPTIONS are predefined by the system and have a special meaning: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OTHERS: Covers all user-defined exceptions in the called function module. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR_MESSAGE: This exception instructs the system to ignore S messages, I messages and W messages until return from the function module (although they still appear in the log during background processing). When an E message or an A message occurs, the called function module terminates, as if the exception ERROR_MESSAGE has been triggered. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: WA_SFLIGHT TYPE SFLIGHT, &lt;/P&gt;&lt;P&gt;      P_LOSS LIKE SFLIGHT-PAYMENTSUM, &lt;/P&gt;&lt;P&gt;      P_REVENUE LIKE SFLIGHT-PRICE, &lt;/P&gt;&lt;P&gt;      P_CARRID LIKE SFLIGHT-CARRID. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;SELECT * FROM SFLIGHT INTO WA_SFLIGHT WHERE CARRID = P_CARRID ... . &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CALCULATE_REVENUE_LOSS' &lt;/P&gt;&lt;P&gt;     EXPORTING &lt;/P&gt;&lt;P&gt;          PAYMENTSUM = WA_SFLIGHT-PAYMENTSUM &lt;/P&gt;&lt;P&gt;          SEATSOCC   = WA_SFLIGHT-SEATSOCC &lt;/P&gt;&lt;P&gt;          PRICE      = WA_SFLIGHT-PRICE &lt;/P&gt;&lt;P&gt;     IMPORTING &lt;/P&gt;&lt;P&gt;          LOSS       = P_LOSS &lt;/P&gt;&lt;P&gt;          REVENUE    = P_REVENUE &lt;/P&gt;&lt;P&gt;     EXCEPTIONS &lt;/P&gt;&lt;P&gt;          OTHERS     = 1. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;ENDSELECT. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;TABLES SFLIGHT. &lt;/P&gt;&lt;P&gt;DATA: ITAB TYPE STANDARD TABLE OF BCAXX WITH &lt;/P&gt;&lt;P&gt;NON-UNIQUE DEFAULT KEY INITIAL SIZE 10. &lt;/P&gt;&lt;P&gt;P_YEAR ... . &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'FILL_SEATTAB' &lt;/P&gt;&lt;P&gt;     EXPORTING &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;          YEAR     = P_YEAR &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;     TABLES &lt;/P&gt;&lt;P&gt;          SEATTAB  = ITAB &lt;/P&gt;&lt;P&gt;     EXCEPTIONS &lt;/P&gt;&lt;P&gt;          NO_ENTRY = 1 &lt;/P&gt;&lt;P&gt;          OTHERS   = 2. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CASE SY-SUBRC. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;     WHEN 1. ... &lt;/P&gt;&lt;P&gt;     WHEN 2. ... &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2007 13:19:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception/m-p/3098225#M735105</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-05T13:19:32Z</dc:date>
    </item>
  </channel>
</rss>

