<?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 in Loop w/o exiting loop. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-in-loop-w-o-exiting-loop/m-p/6683498#M1449976</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also use 'CONTINUE' after the CATCH statement I discovered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Mar 2010 12:45:19 GMT</pubDate>
    <dc:creator>kmoore007</dc:creator>
    <dc:date>2010-03-15T12:45:19Z</dc:date>
    <item>
      <title>Catch in Loop w/o exiting loop.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-in-loop-w-o-exiting-loop/m-p/6683496#M1449974</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;I'm performing a LOOP at table.  ENDLOOP.  Within the loop I have a TRY. ENDTRY. CATCH.  This is so I can perform a arithmatic statement and catch any errors.  The problem is, if an error occurs it exits the LOOP.  I don't want to exit the entire LOOP statement.  I just want to continue on with the next record in my internal table.  But instead, the loop is exited.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  LOOP AT t_pcts ASSIGNING &amp;lt;wa_pcts&amp;gt;.
        TRY.
            &amp;lt;wa_pcts&amp;gt;-percent = &amp;lt;wa_pcts&amp;gt;-expprod / &amp;lt;wa_pcts&amp;gt;-actprod.
          CATCH cx_root INTO oref.
            text = oref-&amp;gt;get_text( ).
        ENDTRY.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 12:04:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-in-loop-w-o-exiting-loop/m-p/6683496#M1449974</guid>
      <dc:creator>kmoore007</dc:creator>
      <dc:date>2010-03-15T12:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Catch in Loop w/o exiting loop.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-in-loop-w-o-exiting-loop/m-p/6683497#M1449975</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;check if your program is activated. TRY CATCH in LOOP works fine.&lt;/P&gt;&lt;P&gt;For my program:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA gt_vbrp TYPE TABLE OF vbrp WITH HEADER LINE.
APPEND INITIAL LINE TO gt_vbrp.
APPEND INITIAL LINE TO gt_vbrp.
APPEND INITIAL LINE TO gt_vbrp.
LOOP AT gt_vbrp.
  TRY.
      gt_vbrp-fkimg = 100 / gt_vbrp-fkimg.
    CATCH cx_root.
      WRITE: / 'Exception'.
  ENDTRY.
  WRITE: / sy-tabix.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I get correct result:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Exception
         1
Exception
         2
Exception
         3
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Program does not interrupt the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Przemysław&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 12:41:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-in-loop-w-o-exiting-loop/m-p/6683497#M1449975</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-15T12:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: Catch in Loop w/o exiting loop.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-in-loop-w-o-exiting-loop/m-p/6683498#M1449976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can also use 'CONTINUE' after the CATCH statement I discovered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 12:45:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-in-loop-w-o-exiting-loop/m-p/6683498#M1449976</guid>
      <dc:creator>kmoore007</dc:creator>
      <dc:date>2010-03-15T12:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: Catch in Loop w/o exiting loop.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-in-loop-w-o-exiting-loop/m-p/6683499#M1449977</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;CONTINUE after CATCH is unnecessary - program is processing next row automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Przemysław&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Mar 2010 12:46:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-in-loop-w-o-exiting-loop/m-p/6683499#M1449977</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-15T12:46:51Z</dc:date>
    </item>
  </channel>
</rss>

