<?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: obligatory endcatch? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/obligatory-endcatch/m-p/3097361#M734853</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lopes,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at example &amp;lt;a href="https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP&lt;EM&gt;Objects&lt;/EM&gt;-&lt;EM&gt;Defining&lt;/EM&gt;a&lt;EM&gt;Class-based&lt;/EM&gt;exceptions"&amp;gt;ABAP Objects - Defining a Class-based exceptions&amp;lt;/a&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you're using exception class you don't use ENDCATCH. &lt;/P&gt;&lt;P&gt;When the exception is triggered the system continue the process after ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must use ENDCATCH when you're using SYSTEM-EXCEPTIONS as the follow example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: result   TYPE i, 
          number TYPE i. 

CATCH SYSTEM-EXCEPTIONS arithmetic_errors = 4 
                        OTHERS = 8. 
*  The value of number is 0 (  1 / 0 )
  result = 1 / number. 
  
ENDCATCH. 

* If sy-subrc is not equal 0 the SYSTEM-EXCEPTIONS was triggered
IF sy-subrc is NOT INITIAL. 
*  error 
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcelo Ramos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Nov 2007 15:19:18 GMT</pubDate>
    <dc:creator>marcelo_ramos1</dc:creator>
    <dc:date>2007-11-28T15:19:18Z</dc:date>
    <item>
      <title>obligatory endcatch?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/obligatory-endcatch/m-p/3097360#M734852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the next code:&lt;/P&gt;&lt;P&gt;***********************&lt;/P&gt;&lt;P&gt;CLASS bank_application IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;METHOD main.&lt;/P&gt;&lt;P&gt;DATA: account1 TYPE REF TO account,&lt;/P&gt;&lt;P&gt;account2 TYPE REF TO account,&lt;/P&gt;&lt;P&gt;amnt TYPE i,&lt;/P&gt;&lt;P&gt;exc_ref TYPE REF TO cx_negative_amount,&lt;/P&gt;&lt;P&gt;text TYPE string.&lt;/P&gt;&lt;P&gt;CREATE OBJECT: account1 EXPORTING id = `...`,&lt;/P&gt;&lt;P&gt;account2 EXPORTING id = `...`.&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;amnt = ...&lt;/P&gt;&lt;P&gt;account1-&amp;gt;transfer( EXPORTING amount = amnt&lt;/P&gt;&lt;P&gt;target = account2 ).&lt;/P&gt;&lt;P&gt;CATCH cx_negative_amount INTO exc_ref.&lt;/P&gt;&lt;P&gt;text = exc_ref-&amp;gt;get_text( ).&lt;/P&gt;&lt;P&gt;MESSAGE text TYPE 'I'.&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;*******************************&lt;/P&gt;&lt;P&gt;the statement endcatch? Why?&lt;/P&gt;&lt;P&gt;Is used the statement endcatch when I want continue type code after &amp;lt;b&amp;gt;"MESSAGE text TYPE 'I'."&amp;lt;/b&amp;gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cordial greetings&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Nov 2007 13:55:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/obligatory-endcatch/m-p/3097360#M734852</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-16T13:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: obligatory endcatch?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/obligatory-endcatch/m-p/3097361#M734853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lopes,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at example &amp;lt;a href="https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP&lt;EM&gt;Objects&lt;/EM&gt;-&lt;EM&gt;Defining&lt;/EM&gt;a&lt;EM&gt;Class-based&lt;/EM&gt;exceptions"&amp;gt;ABAP Objects - Defining a Class-based exceptions&amp;lt;/a&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you're using exception class you don't use ENDCATCH. &lt;/P&gt;&lt;P&gt;When the exception is triggered the system continue the process after ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must use ENDCATCH when you're using SYSTEM-EXCEPTIONS as the follow example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: result   TYPE i, 
          number TYPE i. 

CATCH SYSTEM-EXCEPTIONS arithmetic_errors = 4 
                        OTHERS = 8. 
*  The value of number is 0 (  1 / 0 )
  result = 1 / number. 
  
ENDCATCH. 

* If sy-subrc is not equal 0 the SYSTEM-EXCEPTIONS was triggered
IF sy-subrc is NOT INITIAL. 
*  error 
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcelo Ramos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2007 15:19:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/obligatory-endcatch/m-p/3097361#M734853</guid>
      <dc:creator>marcelo_ramos1</dc:creator>
      <dc:date>2007-11-28T15:19:18Z</dc:date>
    </item>
  </channel>
</rss>

