<?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: Catch Exception Error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495517#M1653523</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for quick reply Mishra.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But unfortunately it didn't work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 22 Jan 2012 11:23:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2012-01-22T11:23:40Z</dc:date>
    <item>
      <title>Catch Exception Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495509#M1653515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any way to catch this exception, without checking or changing numerical value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CATCH SYSTEM-EXCEPTIONS
    convt_no_number = 1
    convt_overflow = 2
    bcd_field_overflow = 3
    bcd_overflow = 4.
 
    DO 10000000000000 TIMES. "&amp;lt;&amp;lt;--Runtime Error-BCD_OVERFLOW (Overflow during an arithmetic operation)
      write:/ sy-index.
    ENDDO.
 
  ENDCATCH.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sain&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jan 2012 06:51:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495509#M1653515</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-22T06:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Catch Exception Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495510#M1653516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CX_SY_ARITHMETIC_OVERFLOW&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is a catchable exception. put it in a try catch block and this exception class will catch your error&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jan 2012 08:59:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495510#M1653516</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-22T08:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Catch Exception Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495511#M1653517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;TRY .
      DO  10000000000000 TIMES.
      write:/ sy-index.
      ENDDO.
    CATCH CX_SY_ARITHMETIC_OVERFLOW."CX_SY_CONVERSION_OVERFLOW.

  ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Still same error.&lt;/P&gt;&lt;P&gt;My main intension is to solve this with exception handling.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jan 2012 09:33:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495511#M1653517</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-22T09:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: Catch Exception Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495512#M1653518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: p1 type p.
  TRY. 
p1 = 10000000000000.
     DO  p1 TIMES.
      write:/ sy-index.
      ENDDO.
    CATCH cx_sy_arithmetic_error.  "outside value range 
  ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jan 2012 09:50:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495512#M1653518</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-22T09:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Catch Exception Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495513#M1653519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;oopsi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: p1 type p.
  TRY. 
p1 = 10000000000000.
     DO  p1 TIMES.
      write:/ sy-index.
      ENDDO.
    CATCH CX_SY_ARITHMETIC_OVERFLOW.  "try both the examples
  ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jan 2012 09:59:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495513#M1653519</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-22T09:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Catch Exception Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495514#M1653520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Mishra,&lt;/P&gt;&lt;P&gt;Thanks for answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Try.
p1 = 10000000000000.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this one will work for sure. But I am trying to catch error resulting in a time consuming loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jan 2012 10:28:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495514#M1653520</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-22T10:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Catch Exception Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495515#M1653521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ook.. got your point. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CATCH SYSTEM-EXCEPTIONS ARITHMETIC_ERRORS = 5.
    DO 10000000000000 TIMES. "&amp;lt;&amp;lt;--Runtime Error-BCD_OVERFLOW (Overflow during an arithmetic operation)
      write:/ sy-index.
    ENDDO.
  ENDCATCH.
ENDCATCH.
IF sy-subrc = 5.
 wrie 'overflow'.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jan 2012 10:44:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495515#M1653521</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-22T10:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Catch Exception Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495516#M1653522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if this does not work then pass the sy-index + 1 to an integer variable before the enddo.. this should definitely work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jan 2012 10:51:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495516#M1653522</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-22T10:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Catch Exception Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495517#M1653523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for quick reply Mishra.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But unfortunately it didn't work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jan 2012 11:23:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495517#M1653523</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-01-22T11:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: Catch Exception Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495518#M1653524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;As explained in the ABAP documentation, the number of iterations has to match a I type (integer up to 2 billion). Note: SY-INDEX is also an integer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is fun here is that the ABAP runtime environment doesn't apply the CATCH to the conversion overflow when it's done in the DO statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do this, the exception is handled correctly: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data pack type p length 10 DECIMALS 0.
data integer type i.
CATCH SYSTEM-EXCEPTIONS
    convt_no_number = 1
    convt_overflow = 2
    bcd_field_overflow = 3
    bcd_overflow = 4.
pack = 10000000000000.
integer = pack. "&amp;lt;==== Here exception BCD_OVERFLOW occurs and is handled by the CATCH
    DO integer TIMES.
      write:/ sy-index.
    ENDDO.
  ENDCATCH.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now, if you want to do a big big loop, you have to accommodate with the system's restriction by using a nested loop:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA pack TYPE p LENGTH 8 DECIMALS 0. "up to 15 digits
  DO 1000000 TIMES.
    DO 10000000 TIMES.
      ADD 1 TO pack.
      write:/ pack.
    ENDDO.
  ENDDO.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Sandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jan 2012 21:51:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-error/m-p/8495518#M1653524</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2012-01-22T21:51:25Z</dc:date>
    </item>
  </channel>
</rss>

