<?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: Throw statement equivalent in ABAP Objects in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/throw-statement-equivalent-in-abap-objects/m-p/1726486#M316646</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/83/636d2012fc11d5991e00508b5d5211/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/83/636d2012fc11d5991e00508b5d5211/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Nov 2006 17:14:09 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-11-15T17:14:09Z</dc:date>
    <item>
      <title>Throw statement equivalent in ABAP Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/throw-statement-equivalent-in-abap-objects/m-p/1726485#M316645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to raise an exception and use a throw statement after catch inside try endtry in ABAP objects. Later i understood that there is no throw statement defined in ABAP objects. Could anyone help me out to understand the equivalent throw statement in ABAP and how to use in raise exception. I am pasting my code below for reference.&lt;/P&gt;&lt;P&gt;try.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;    CATCH Zxx_EXCEPTION into err.&lt;/P&gt;&lt;P&gt;     write:/ err-&amp;gt;local_text.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    message err-&amp;gt;LOCAL_TEXT type 'I'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     if err-&amp;gt;local_text = ZIF_XXXX~BUSOBJLOCKED.&lt;/P&gt;&lt;P&gt;      throw CX_AI_APPLICATION_FAULT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endtry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Deno&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 17:00:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/throw-statement-equivalent-in-abap-objects/m-p/1726485#M316645</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-15T17:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Throw statement equivalent in ABAP Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/throw-statement-equivalent-in-abap-objects/m-p/1726486#M316646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/83/636d2012fc11d5991e00508b5d5211/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/83/636d2012fc11d5991e00508b5d5211/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 17:14:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/throw-statement-equivalent-in-abap-objects/m-p/1726486#M316646</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-11-15T17:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Throw statement equivalent in ABAP Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/throw-statement-equivalent-in-abap-objects/m-p/1726487#M316647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Deno&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The TRY/CATCH logic of ABAP-OO is pretty much the same like in Java. Instead of throwing exception we have to raise them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Method execute somewhere raise an exception of class zcx_myexception.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method execute.

  if ( condition = abap_true ).
 ... 
  else.
    RAISE EXCEPTION TYPE zcx_myexception
      EXPORTING
        textid = ...
        &amp;lt;parameter&amp;gt; = ...
  endif.
  
endmethod.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TRY.
  call method go-&amp;gt;execute( ).

  CATCH zcx_myexception INTO lo_error.
* Do error handling
ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the method that calls go-&amp;gt;execute does not surround the method call by TRY/CATCH then it must define the exception class in its interface and, thereby, propagate the exception to the next higher level calling method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 19:51:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/throw-statement-equivalent-in-abap-objects/m-p/1726487#M316647</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2006-11-15T19:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Throw statement equivalent in ABAP Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/throw-statement-equivalent-in-abap-objects/m-p/1726488#M316648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just on slight addition to Uwe how to propagte Instances of exception classes in the signature of methods depends wether they inherit from &lt;/P&gt;&lt;P&gt;CX_NO_CHECK&lt;/P&gt;&lt;P&gt;CX_DYNAMIC_CHECK&lt;/P&gt;&lt;P&gt;CX_STATIC_CHECK&lt;/P&gt;&lt;P&gt;you will find some documentation attached to these classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;  Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 22:22:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/throw-statement-equivalent-in-abap-objects/m-p/1726488#M316648</guid>
      <dc:creator>former_member183804</dc:creator>
      <dc:date>2006-11-15T22:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Throw statement equivalent in ABAP Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/throw-statement-equivalent-in-abap-objects/m-p/1726489#M316649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Klaus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate very much your refinements and corrections because they help me to proceed from the (still) beginner level to the advanced ABAP-OO developer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards (from Zürich)&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Nov 2006 22:45:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/throw-statement-equivalent-in-abap-objects/m-p/1726489#M316649</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2006-11-15T22:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Throw statement equivalent in ABAP Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/throw-statement-equivalent-in-abap-objects/m-p/1726490#M316650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Who not? Thanks for your comments.&lt;/P&gt;&lt;P&gt;Hasta Luego&lt;/P&gt;&lt;P&gt;  Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2006 06:23:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/throw-statement-equivalent-in-abap-objects/m-p/1726490#M316650</guid>
      <dc:creator>former_member183804</dc:creator>
      <dc:date>2006-11-16T06:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Throw statement equivalent in ABAP Objects</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/throw-statement-equivalent-in-abap-objects/m-p/1726491#M316651</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;Thanks for all ur replies. In my scenario, once i get an exception Business object locked, I have to throw the CX_AI_Application_fault message again to send the process to queue. So that there is no manual intervention required to restart. Once the business object lock problem gets over, automatically the queue opens and message flow resumes without any manual intervention. So please let me know how this can be achieved here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Deno&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2006 06:50:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/throw-statement-equivalent-in-abap-objects/m-p/1726491#M316651</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-16T06:50:30Z</dc:date>
    </item>
  </channel>
</rss>

