<?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 Syntax in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-syntax/m-p/5791511#M1309998</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi Experts,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt;  I have already been through the SAP help documentation. Just needed some help immediately, therefore I posted here.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you didn't read the syntax of the statement, and if you had you would have seen a sample program.  These forums are not for people who can't be bothered to put the effort in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Jun 2009 16:39:57 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2009-06-29T16:39:57Z</dc:date>
    <item>
      <title>CATCH Exception Syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-syntax/m-p/5791506#M1309993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Please find the below code and let me know, whether this is correct or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TRY.
      LOOP AT git_tc INTO gwa_tc.
        IF gwa_tc-oldqty NE gv_old_qty.
          IF NOT gwa_tc-newqty1 IS INITIAL.
            gwa_tc-newqty1 = gwa_tc-newqty1 * gv_old_qty.
          ENDIF.
          IF NOT gwa_tc-newqty2 IS INITIAL.
            gwa_tc-newqty2 = gwa_tc-newqty2 * gv_old_qty.
          ENDIF.
          IF NOT gwa_tc-newqty3 IS INITIAL.
            gwa_tc-newqty3 = gwa_tc-newqty3 * gv_old_qty.
          ENDIF.
          IF NOT gwa_tc-newqty4 IS INITIAL.
            gwa_tc-newqty4 = gwa_tc-newqty4 * gv_old_qty.
          ENDIF.
          IF NOT gwa_tc-newqty5 IS INITIAL.
            gwa_tc-newqty5 = gwa_tc-newqty5 * gv_old_qty.
          ENDIF.
          SHIFT gwa_tc-newqty1 LEFT DELETING LEADING space.
          SHIFT gwa_tc-newqty2 LEFT DELETING LEADING space.
          SHIFT gwa_tc-newqty3 LEFT DELETING LEADING space.
          SHIFT gwa_tc-newqty4 LEFT DELETING LEADING space.
          SHIFT gwa_tc-newqty5 LEFT DELETING LEADING space.
        ENDIF.
        MODIFY git_tc FROM gwa_tc TRANSPORTING newqty1 newqty2 newqty3 newqty4 newqty5.
      ENDLOOP.
    CATCH SYSTEM-EXCEPTIONS arithmetic_errors = 4.
      RAISE exception.
    ENDCATCH.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please correct the above code, if needed. I need to handle any kind of Overflow errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chandan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 13:36:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-syntax/m-p/5791506#M1309993</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-29T13:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: CATCH Exception Syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-syntax/m-p/5791507#M1309994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not read the F1 help onCATCH SYSTEM-EXCEPTIONS, &lt;STRONG&gt;which even has an example on how to use it&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 13:39:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-syntax/m-p/5791507#M1309994</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2009-06-29T13:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: CATCH Exception Syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-syntax/m-p/5791508#M1309995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is not correct, look via F1 for CATCH help or at [CATCH SYSTEM-EXCEPTIONS |http://help.sap.com/abapdocu/en/ABAPCATCH_SYS.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Hint: calculation should be written between CATCH and ENDCATCH;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 13:47:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-syntax/m-p/5791508#M1309995</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2009-06-29T13:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: CATCH Exception Syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-syntax/m-p/5791509#M1309996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I have already been through the SAP help documentation. Just needed some help immediately, therefore I posted here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I removed the TRY as TRY and CATCH SYSTEM-EXCEPTIONS wont work simultaneously.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Is this correct now:&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CATCH SYSTEM-EXCEPTIONS arithmetic_errors = 4.
    LOOP AT git_tc INTO gwa_tc.
      IF gwa_tc-oldqty NE gv_old_qty.
        IF NOT gwa_tc-newqty1 IS INITIAL.
          gwa_tc-newqty1 = gwa_tc-newqty1 * gv_old_qty.
        ENDIF.
        IF NOT gwa_tc-newqty2 IS INITIAL.
          gwa_tc-newqty2 = gwa_tc-newqty2 * gv_old_qty.
        ENDIF.
        IF NOT gwa_tc-newqty3 IS INITIAL.
          gwa_tc-newqty3 = gwa_tc-newqty3 * gv_old_qty.
        ENDIF.
        IF NOT gwa_tc-newqty4 IS INITIAL.
          gwa_tc-newqty4 = gwa_tc-newqty4 * gv_old_qty.
        ENDIF.
        IF NOT gwa_tc-newqty5 IS INITIAL.
          gwa_tc-newqty5 = gwa_tc-newqty5 * gv_old_qty.
        ENDIF.
        SHIFT gwa_tc-newqty1 LEFT DELETING LEADING space.
        SHIFT gwa_tc-newqty2 LEFT DELETING LEADING space.
        SHIFT gwa_tc-newqty3 LEFT DELETING LEADING space.
        SHIFT gwa_tc-newqty4 LEFT DELETING LEADING space.
        SHIFT gwa_tc-newqty5 LEFT DELETING LEADING space.
      ENDIF.
      MODIFY git_tc FROM gwa_tc TRANSPORTING newqty1 newqty2 newqty3 newqty4 newqty5.
    ENDLOOP.
    RAISE exception.
  ENDCATCH.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 13:52:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-syntax/m-p/5791509#M1309996</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-29T13:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: CATCH Exception Syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-syntax/m-p/5791510#M1309997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : exp TYPE REF TO cx_root .

TRY.
      LOOP AT git_tc INTO gwa_tc.
        IF gwa_tc-oldqty NE gv_old_qty.
          IF NOT gwa_tc-newqty1 IS INITIAL.
            gwa_tc-newqty1 = gwa_tc-newqty1 * gv_old_qty.
          ENDIF.
          IF NOT gwa_tc-newqty2 IS INITIAL.
            gwa_tc-newqty2 = gwa_tc-newqty2 * gv_old_qty.
          ENDIF.
          IF NOT gwa_tc-newqty3 IS INITIAL.
            gwa_tc-newqty3 = gwa_tc-newqty3 * gv_old_qty.
          ENDIF.
          IF NOT gwa_tc-newqty4 IS INITIAL.
            gwa_tc-newqty4 = gwa_tc-newqty4 * gv_old_qty.
          ENDIF.
          IF NOT gwa_tc-newqty5 IS INITIAL.
            gwa_tc-newqty5 = gwa_tc-newqty5 * gv_old_qty.
          ENDIF.
          SHIFT gwa_tc-newqty1 LEFT DELETING LEADING space.
          SHIFT gwa_tc-newqty2 LEFT DELETING LEADING space.
          SHIFT gwa_tc-newqty3 LEFT DELETING LEADING space.
          SHIFT gwa_tc-newqty4 LEFT DELETING LEADING space.
          SHIFT gwa_tc-newqty5 LEFT DELETING LEADING space.
        ENDIF.
        MODIFY git_tc FROM gwa_tc TRANSPORTING newqty1 newqty2 newqty3 newqty4 newqty5.
      ENDLOOP.
  CATCH cx_root INTO exp. 
    DATA : cl_name TYPE abap_abstypename .
    CALL METHOD cl_abap_classdescr=&amp;gt;get_class_name
      EXPORTING
        p_object = exp
      RECEIVING
        p_name   = cl_name.

    IF cl_name = '\CLASS=CX_SY_ARITHMETIC_OVERFLOW' .
*       Your code here
    ENDIF.
ENDTRY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 14:07:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-syntax/m-p/5791510#M1309997</guid>
      <dc:creator>Pawan_Kesari</dc:creator>
      <dc:date>2009-06-29T14:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: CATCH Exception Syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-syntax/m-p/5791511#M1309998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi Experts,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt;  I have already been through the SAP help documentation. Just needed some help immediately, therefore I posted here.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you didn't read the syntax of the statement, and if you had you would have seen a sample program.  These forums are not for people who can't be bothered to put the effort in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 16:39:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-exception-syntax/m-p/5791511#M1309998</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2009-06-29T16:39:57Z</dc:date>
    </item>
  </channel>
</rss>

