<?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: Back to first record in loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/back-to-first-record-in-loop/m-p/12642695#M2014383</link>
    <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; and what about replace LOOP with a READ... INDEX ... ? &lt;/P&gt;</description>
    <pubDate>Tue, 11 Oct 2022 14:03:57 GMT</pubDate>
    <dc:creator>FredericGirod</dc:creator>
    <dc:date>2022-10-11T14:03:57Z</dc:date>
    <item>
      <title>Back to first record in loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/back-to-first-record-in-loop/m-p/12642693#M2014381</link>
      <description>&lt;P&gt;Hello Everybody,&lt;/P&gt;
  &lt;P&gt;I have a loop. i want to if the condition is met, back to first record and resume first line.&lt;/P&gt;
  &lt;P&gt;How can i do?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 13:03:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/back-to-first-record-in-loop/m-p/12642693#M2014381</guid>
      <dc:creator>former_member751715</dc:creator>
      <dc:date>2022-10-11T13:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Back to first record in loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/back-to-first-record-in-loop/m-p/12642694#M2014382</link>
      <description>&lt;P&gt;Here is pseudo code. I'd probably not code like that, but I don't know your exact logic.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DO.
  repeat_loop = abap_false.
  LOOP AT itab ... WHERE ...
    IF ...
      repeat_loop = abap_true.
      EXIT. " leave LOOP AT to go back to first record and resume first line
    ENDIF.
  ENDLOOP.
  IF repeat_loop = abap_false.
    EXIT. " leave DO
  ENDIF.
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 14:01:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/back-to-first-record-in-loop/m-p/12642694#M2014382</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-10-11T14:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Back to first record in loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/back-to-first-record-in-loop/m-p/12642695#M2014383</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; and what about replace LOOP with a READ... INDEX ... ? &lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 14:03:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/back-to-first-record-in-loop/m-p/12642695#M2014383</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-10-11T14:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Back to first record in loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/back-to-first-record-in-loop/m-p/12642696#M2014384</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt;  I said that "I'd probably not code like that" because "I don't know your exact logic", so any proposal could be valid. I hope that my comment will help the OP to elaborate the question.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 16:34:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/back-to-first-record-in-loop/m-p/12642696#M2014384</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-10-11T16:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Back to first record in loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/back-to-first-record-in-loop/m-p/12642697#M2014385</link>
      <description>&lt;P&gt;Ok, i will make an simple example;&lt;BR /&gt; the following loop is on row 10 of the table and if statement is okay. I mark to lv_az_ok. now i have to go back for the first line. (my process is similar but of course there is a more complex calculation)&lt;/P&gt; 
&lt;PRE&gt;&lt;CODE&gt;select * from sflight into table @data(t_sflight).&amp;lt;br&amp;gt;loop at t_sflight into data(_sflight).
  IF _Sflight-carrid = 'AZ'.
    DATA(lv_az_ok)  = 'X'.
     "leave LOOP AT to go back to first record and resume first line&amp;lt;/em&amp;gt;
  ENDIF.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;
 &lt;P&gt;Also, the above code is a solution for me. However, i'am still curious about your choice. Maybe this could be the new syntax. And no suitable for me read table or index.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 17:17:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/back-to-first-record-in-loop/m-p/12642697#M2014385</guid>
      <dc:creator>former_member751715</dc:creator>
      <dc:date>2022-10-11T17:17:18Z</dc:date>
    </item>
  </channel>
</rss>

