<?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: TRY to CATCH a system exception in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/try-to-catch-a-system-exception/m-p/2900027#M681942</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, the catch isnt executed, the abend says thats happening when i'm assigning 'A' to a decimal varbiable. Of course this is not possible, but i want to handle this myself without an abend. And yes, the exception is exactly the same i wrote in my catch expression and which finally abends the program.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Oct 2007 08:45:23 GMT</pubDate>
    <dc:creator>rainer_hbenthal</dc:creator>
    <dc:date>2007-10-11T08:45:23Z</dc:date>
    <item>
      <title>TRY to CATCH a system exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/try-to-catch-a-system-exception/m-p/2900025#M681940</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;in a class, i have two methods, let me call them A and B.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method A is calling method B. In method B an exception CX_SY_CONVERSION_NO_NUMBER may occur. So the code is something like this in method A:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

TRY.
  me-&amp;gt;B( par ).

  catch CX_SY_CONVERSION_NO_NUMBER.
    do_some_error_handling

ENDTRY.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stll the program abends with an uncaught exception CX_SY_CONVERSION_NO_NUMBER which occured in method B. Why isnt this be caught in method A? How can i handle this in method A with try and catch?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2007 08:29:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/try-to-catch-a-system-exception/m-p/2900025#M681940</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2007-10-11T08:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: TRY to CATCH a system exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/try-to-catch-a-system-exception/m-p/2900026#M681941</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;Strange - have you checked whether your CATCH block is actually executed? If so, are you shure that your exception code doesn't raise an exception itself?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Joerg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2007 08:35:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/try-to-catch-a-system-exception/m-p/2900026#M681941</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-11T08:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: TRY to CATCH a system exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/try-to-catch-a-system-exception/m-p/2900027#M681942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, the catch isnt executed, the abend says thats happening when i'm assigning 'A' to a decimal varbiable. Of course this is not possible, but i want to handle this myself without an abend. And yes, the exception is exactly the same i wrote in my catch expression and which finally abends the program.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2007 08:45:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/try-to-catch-a-system-exception/m-p/2900027#M681942</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2007-10-11T08:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: TRY to CATCH a system exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/try-to-catch-a-system-exception/m-p/2900028#M681943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rainer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make sure everything is caught catch the exception cx_root.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that doesn't help you could do the following:&lt;/P&gt;&lt;P&gt;don't use TRY ... ENDTRY.&lt;/P&gt;&lt;P&gt;But use CATCH ... ENDCATCH:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CATCH SYSTEM-EXCEPTIONS.
  me-&amp;gt;B( par ).
  if sy-subrc &amp;lt;&amp;gt; 0.
    do_some_error_handling.
  endif.
ENDCATCH.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Sven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2007 08:49:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/try-to-catch-a-system-exception/m-p/2900028#M681943</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-11T08:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: TRY to CATCH a system exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/try-to-catch-a-system-exception/m-p/2900029#M681944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If i'm doing it like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try.&lt;/P&gt;&lt;P&gt;  tmp = 'A'.&lt;/P&gt;&lt;P&gt;  me-&amp;gt;convert( parameter ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;catch cx....&lt;/P&gt;&lt;P&gt;endtry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the exception is caught. I thought that calling a methof/function where an exception occured is caught too, but is this not true? Are systemexceptions are being handled in the same scope?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2007 08:59:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/try-to-catch-a-system-exception/m-p/2900029#M681944</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2007-10-11T08:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: TRY to CATCH a system exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/try-to-catch-a-system-exception/m-p/2900030#M681945</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;Here the Exception is triggered by method B. So u must have to code like this.&lt;/P&gt;&lt;P&gt;in the Method B Definition you must add the addition &lt;/P&gt;&lt;P&gt;RAISING CX_SY_CONVERSION_NO_NUMBER as a parameter. Then this code works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;  me-&amp;gt;B( par ).&lt;/P&gt;&lt;P&gt;  catch CX_SY_CONVERSION_NO_NUMBER.&lt;/P&gt;&lt;P&gt;    do_some_error_handling&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REWARD IF HELPFUL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2007 09:00:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/try-to-catch-a-system-exception/m-p/2900030#M681945</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-10-11T09:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: TRY to CATCH a system exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/try-to-catch-a-system-exception/m-p/2900031#M681946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi thanks, i really have forgotten the raising clause....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2007 09:20:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/try-to-catch-a-system-exception/m-p/2900031#M681946</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2007-10-11T09:20:19Z</dc:date>
    </item>
  </channel>
</rss>

