<?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: ABAP OO Exception Class based processing in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-exception-class-based-processing/m-p/808986#M41599</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Chetan,&lt;/P&gt;&lt;P&gt;in basic the raise exception type xxx creates an exception object and aborts normal execution continuing in the enclosing try block. &lt;/P&gt;&lt;P&gt;The Abap runtime contains some optimizations regarding the try block has an 'into xxx' clause. But as long you use the same exception you cant take benefit from this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far I understand your problem you have two different kind of severities. So I would use 2 differnt exception classes (maybe derived from a common parent type, or one from the other).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So both the code which throws the exception and the one which catches it are aware of the different semantic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 06 Nov 2004 10:00:29 GMT</pubDate>
    <dc:creator>former_member183804</dc:creator>
    <dc:date>2004-11-06T10:00:29Z</dc:date>
    <item>
      <title>ABAP OO Exception Class based processing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-exception-class-based-processing/m-p/808985#M41598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: In going forward with SAP WAS 6.20, one can handle exceptions using exception-class based handling using RAISE EXCEPTION TYPE abc and then CATCHing it in TRY/ ENDTRY block. Standard method like GET_TEXT can be used to get the text of the exception raised.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question: If I know the EXCEPTION CLASS and Exception ID of my exception class, is it possible to get the exception text directly from the repository without creating the exception class object?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g. Exception class is CX_MY_SECRET_ID&lt;/P&gt;&lt;P&gt;and Exception IDs for this class are &lt;/P&gt;&lt;P&gt;ID_NOT_FOUND, &lt;/P&gt;&lt;P&gt;ID_EXPIRED, &lt;/P&gt;&lt;P&gt;ID_IS_FOR_SPECIAL_ACCESS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g. last two exception IDs are my warning conditions, and if such conditions are encountered, all I want to do is collect the warning messages. Whereas first exception ID condition (i.e. ID_NOT_FOUND) is an error for me, in which I have pass the exception back to the calling program. E.g. the source code is like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM.......&lt;/P&gt;&lt;P&gt;If ID is not found&lt;/P&gt;&lt;P&gt;   RAISE EXCEPTION TYPE ZCX_MY_SECRET_ID&lt;/P&gt;&lt;P&gt;           EXPORTING TEXT_ID = 'ID_NOT_FOUND'.&lt;/P&gt;&lt;P&gt;else if ID has expired&lt;/P&gt;&lt;P&gt;   ...... then do I have to first raise the exception like raised above and CATCH it before I can get its text? or can I get the exception text directly without raising the exception first (as I know i have to retrieve the text of ZCX_MY_SECRET_ID exception class for Exception ID ID_EXPIRED)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In other words, if a certain condition is warning for my program, can I get the condition for that exception (from exception class based on exception class name and exception ID), or do I have to RAISE it first explicitely and then CATCH it immediately and execute GET_TEXT to get its text?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Nov 2004 18:52:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-exception-class-based-processing/m-p/808985#M41598</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2004-11-04T18:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP OO Exception Class based processing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-exception-class-based-processing/m-p/808986#M41599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Chetan,&lt;/P&gt;&lt;P&gt;in basic the raise exception type xxx creates an exception object and aborts normal execution continuing in the enclosing try block. &lt;/P&gt;&lt;P&gt;The Abap runtime contains some optimizations regarding the try block has an 'into xxx' clause. But as long you use the same exception you cant take benefit from this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far I understand your problem you have two different kind of severities. So I would use 2 differnt exception classes (maybe derived from a common parent type, or one from the other).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So both the code which throws the exception and the one which catches it are aware of the different semantic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Nov 2004 10:00:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-exception-class-based-processing/m-p/808986#M41599</guid>
      <dc:creator>former_member183804</dc:creator>
      <dc:date>2004-11-06T10:00:29Z</dc:date>
    </item>
  </channel>
</rss>

