<?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 exceptions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/2577303#M589043</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how  can we Catchable runtime error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jul 2007 12:07:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-27T12:07:08Z</dc:date>
    <item>
      <title>exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/2577303#M589043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how  can we Catchable runtime error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 12:07:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/2577303#M589043</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-27T12:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/2577304#M589044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;     HI,&lt;/P&gt;&lt;P&gt;Catchable runtime errors are handled with CATCH SYSTEM-EXCEPTIONSusing the name of the runtime error. To detect semantically related runtime errors using a common name, they are combined into exception groups.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can handle catchable runtime errors in an ABAP program using the following control statements:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CATCH SYSTEM-EXCEPTIONS exc1 = rc1 ... excn = rcn.&lt;/P&gt;&lt;P&gt;  ...&lt;/P&gt;&lt;P&gt;ENDCATCH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the sample code to handle the exceptions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZTEST.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;PARAMETERS number TYPE i. &lt;/P&gt;&lt;P&gt;DATA: result TYPE p DECIMALS 2, &lt;/P&gt;&lt;P&gt;      oref TYPE REF TO cx_root, &lt;/P&gt;&lt;P&gt;      text TYPE string. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;TRY. &lt;/P&gt;&lt;P&gt;    IF ABS( number ) &amp;gt; 100. &lt;/P&gt;&lt;P&gt;      RAISE EXCEPTION TYPE cx_demo_abs_too_large. &lt;/P&gt;&lt;P&gt;    ENDIF. &lt;/P&gt;&lt;P&gt;    PERFORM calculation USING    number &lt;/P&gt;&lt;P&gt;                      CHANGING result &lt;/P&gt;&lt;P&gt;                               text. &lt;/P&gt;&lt;P&gt;  CATCH cx_sy_arithmetic_error INTO oref. &lt;/P&gt;&lt;P&gt;    text = oref-&amp;gt;get_text( ). &lt;/P&gt;&lt;P&gt;  CATCH cx_root INTO oref. &lt;/P&gt;&lt;P&gt;    text = oref-&amp;gt;get_text( ). &lt;/P&gt;&lt;P&gt;ENDTRY. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;IF NOT text IS INITIAL. &lt;/P&gt;&lt;P&gt;  WRITE / text. &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;WRITE: / 'Final result:', result. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;FORM calculation USING    p_number LIKE number &lt;/P&gt;&lt;P&gt;                 CHANGING p_result LIKE result &lt;/P&gt;&lt;P&gt;                          p_text   LIKE text &lt;/P&gt;&lt;P&gt;                          RAISING  cx_sy_arithmetic_error. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  DATA l_oref TYPE REF TO cx_root. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  TRY. &lt;/P&gt;&lt;P&gt;      p_result =  1 / p_number. &lt;/P&gt;&lt;P&gt;      WRITE: / 'Result of division:', p_result. &lt;/P&gt;&lt;P&gt;      p_result = SQRT( p_number ). &lt;/P&gt;&lt;P&gt;      WRITE: / 'Result of square root:', p_result. &lt;/P&gt;&lt;P&gt;    CATCH cx_sy_zerodivide INTO l_oref. &lt;/P&gt;&lt;P&gt;      p_text = l_oref-&amp;gt;get_text( ). &lt;/P&gt;&lt;P&gt;    CLEANUP. &lt;/P&gt;&lt;P&gt;      CLEAR p_result. &lt;/P&gt;&lt;P&gt;  ENDTRY. &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;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 12:08:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/2577304#M589044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-27T12:08:03Z</dc:date>
    </item>
  </channel>
</rss>

