<?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 ABAP exceptions! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-exceptions/m-p/2342279#M516414</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;    Pls tell me a sample code in core abap exception handling&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   ie using raise etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   one more thing  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    we can use this try endtry catch endcatch etc without using oops concept in abap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  will it works &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  looking for your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jun 2007 12:03:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-11T12:03:31Z</dc:date>
    <item>
      <title>ABAP exceptions!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-exceptions/m-p/2342279#M516414</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;    Pls tell me a sample code in core abap exception handling&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   ie using raise etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   one more thing  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    we can use this try endtry catch endcatch etc without using oops concept in abap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  will it works &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  looking for your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 12:03:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-exceptions/m-p/2342279#M516414</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T12:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP exceptions!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-exceptions/m-p/2342280#M516415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;See any std fun module in SE37&lt;/P&gt;&lt;P&gt;you will find lot of this statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;P&gt;      go_cucb-&amp;gt;get_configuration(&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;           is_instance_version = ls_instance_version&lt;/P&gt;&lt;P&gt;           iv_with_db_instance = iv_with_db_instance&lt;/P&gt;&lt;P&gt;           iv_head_request     = lv_head_request&lt;/P&gt;&lt;P&gt;           iv_ref_request      = lv_ref_request&lt;/P&gt;&lt;P&gt;         IMPORTING&lt;/P&gt;&lt;P&gt;           es_cbase            = ls_cfg_head&lt;/P&gt;&lt;P&gt;           et_configuration    = lt_cfg&lt;/P&gt;&lt;P&gt;           eo_cbase_ref        = eo_cbase_ref ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MOVE-CORRESPONDING ls_cfg_head TO ibase-conf.         "#EC ENHOK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LOOP AT lt_cfg REFERENCE INTO ls_inst_ref.&lt;/P&gt;&lt;P&gt;        MOVE-CORRESPONDING ls_inst_ref-&amp;gt;* TO ls_ibco_inst.  "#EC ENHOK&lt;/P&gt;&lt;P&gt;        APPEND ls_ibco_inst TO configuration.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CATCH cx_cbase_error INTO lx_error.&lt;/P&gt;&lt;P&gt;      PERFORM raise_exception&lt;/P&gt;&lt;P&gt;        USING&lt;/P&gt;&lt;P&gt;          lx_error&lt;/P&gt;&lt;P&gt;          space.&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points for useful Answers&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 12:08:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-exceptions/m-p/2342280#M516415</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T12:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP exceptions!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-exceptions/m-p/2342281#M516416</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;Exceptions are situations that occur while an ABAP program is being executed, in which normal continuation of the program does not make any sense.&lt;/P&gt;&lt;P&gt;Exceptions can be raised either implicitly in the ABAP runtime environment or explicitly in the ABAP program.&lt;/P&gt;&lt;P&gt;For example, division by zero leads to an exception in the ABAP runtime environment. It is possible to determine this situation through a query in the ABAP program and to trigger an exception there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the demo program DEMO_HANDLE_EXCEPTIONS in se38.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--&lt;DEL&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;HR originaltext="--------------------------------" /&gt;EXAMPLE FOR RUNTIME ERROR--&lt;P&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------------" /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*DATA : VALUE1 TYPE I.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*VALUE1 = 1 / 0. "----&lt;/P&gt;&lt;HR originaltext="--------" /&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; IT MAKES RUN TIME ERROR.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*WRITE : VALUE1.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*--&lt;DEL&gt;&lt;/DEL&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------" /&gt;EXAMPLE FOR HOW TO CATCH THE ARITHMETIC ERROR AT THE RUN TIME USING SUBRC--&lt;P&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------" /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*DATA : VALUE1 TYPE I.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*CATCH SYSTEM-EXCEPTIONS ARITHMETIC_ERRORS = 1.&lt;/P&gt;&lt;P&gt;*VALUE1 = 1 / 0.&lt;/P&gt;&lt;P&gt;*WRITE : VALUE1.&lt;/P&gt;&lt;P&gt;*ENDCATCH.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*IF SY-SUBRC = 1.&lt;/P&gt;&lt;P&gt;*WRITE : ' IT MAKES ERROR'.&lt;/P&gt;&lt;P&gt;*ELSE.&lt;/P&gt;&lt;P&gt;*WRITE : VALUE1.&lt;/P&gt;&lt;P&gt;*ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in abap program we handle exceptions based on value returned by the system variable SY-SUBRC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;means execution completed sucessfull.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if SY-SUBRC = 1........n.&lt;/P&gt;&lt;P&gt;means execution compleated not sucessfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-sbrc = 0.&lt;/P&gt;&lt;P&gt;write:/ 'execution sucessfull.&lt;/P&gt;&lt;P&gt;**here write logic as per u r requirement&lt;/P&gt;&lt;P&gt;else sy-subrc = '1'&lt;/P&gt;&lt;P&gt;message &lt;/P&gt;&lt;P&gt;elseif sy-subrc eq '2'&lt;/P&gt;&lt;P&gt;message&lt;/P&gt;&lt;P&gt;elseif sy-subrc eq '3'&lt;/P&gt;&lt;P&gt;message&lt;/P&gt;&lt;P&gt;elseif sy-subrc eq '4'&lt;/P&gt;&lt;P&gt;message&lt;/P&gt;&lt;P&gt;endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Messages are defined in SE91..&lt;/P&gt;&lt;P&gt;These messages are of 5 types..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;A Termination Message&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;The message appears in a dialog box, and the program terminates. When the user has confirmed the message, control returns to the next-highest area menu.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;E Error Message&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Depending on the program context, an error dialog appears or the program terminates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;I (Information)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;The message appears in a dialog box. Once the user has confirmed the message, the program continues immediately after the MESSAGE statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;S (Status Message)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;The program continues normally after the MESSAGE statement, and the message is displayed in the status bar of the next screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;W (Warning)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Depending on the program context, an error dialog appears or the program terminates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;X (Exit)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;No message is displayed, and the program terminates with a short dump. Program terminations with a short dump normally only occur when a runtime error occurs. Message type X allows you to force a program termination. The short dump contains the message ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls read the following links:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/fb/35c62bc12711d4b2e80050dadfb92b/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/fb/35c62bc12711d4b2e80050dadfb92b/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Padmam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2007 12:11:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-exceptions/m-p/2342281#M516416</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-11T12:11:32Z</dc:date>
    </item>
  </channel>
</rss>

