<?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 access next element inside the loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415216#M199772</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Friends, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know if its possible to access the next comming element inside the loop as we have in java, FOR loop ++ or +1 stuff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually I have to create dynamic selection ( fields- name, sign, value, I have in an internal table) and inside the where clause I have to put 'AND' or 'OR' depending upon if field is same or change....if the field is same I have to use OR and if field changes I have to use AND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your kind inputs, &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;So I just have to see the next field inside the loop, if next is same, I will place OR at the end of previous statement, and if next comming field is different I have to place AND at the end of previous statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Jun 2006 10:26:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-22T10:26:16Z</dc:date>
    <item>
      <title>access next element inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415216#M199772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Friends, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know if its possible to access the next comming element inside the loop as we have in java, FOR loop ++ or +1 stuff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually I have to create dynamic selection ( fields- name, sign, value, I have in an internal table) and inside the where clause I have to put 'AND' or 'OR' depending upon if field is same or change....if the field is same I have to use OR and if field changes I have to use AND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your kind inputs, &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;So I just have to see the next field inside the loop, if next is same, I will place OR at the end of previous statement, and if next comming field is different I have to place AND at the end of previous statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 10:26:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415216#M199772</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-22T10:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: access next element inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415217#M199773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;lv_tabix = sy-tabix + 1.&lt;/P&gt;&lt;P&gt;read table itab into wa index lv_tabix.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;now the work area wa will have the next record.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 10:28:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415217#M199773</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-22T10:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: access next element inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415218#M199774</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;Use this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  DATA : l_index TYPE sy-tabix.

  LOOP AT t_marc INTO wa_marc.
    l_index = sy-tabix + 1.
    READ TABLE t_mara INTO wa_mara read table itab INDEX l_index.

"Some Processing

    CLEAR l_index. 
  ENDLOOP.



&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun S.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Arun Sambargi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 10:33:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415218#M199774</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-22T10:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: access next element inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415219#M199775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;    Use sy-tabix+1 for internal table and &lt;/P&gt;&lt;P&gt;        sy-index+1 for do loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    loop at itab.&lt;/P&gt;&lt;P&gt;      lv_index = sy-tabix.&lt;/P&gt;&lt;P&gt;      lv_index = lv_index + 1.&lt;/P&gt;&lt;P&gt;     read table itab index lv_index.&lt;/P&gt;&lt;P&gt;       if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;       endif.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;    endloop. &lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Amole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 10:36:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415219#M199775</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-22T10:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: access next element inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415220#M199776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; many thanks for your kind inputs, all replies were more or less same, so points will be awarded on first come first serve bases, but many thanks to all of you for your kind replies, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will be get back if it works as i expected &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;till then...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One question: if table index + 1 (sy-tabix+1) does not exists, I will get DUMP ???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Shah H&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 10:48:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415220#M199776</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-22T10:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: access next element inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415221#M199777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Shah,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare a local variable that holds sy-tabix value.&lt;/P&gt;&lt;P&gt;data : lv_tabix type sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Increase the value by 1.&lt;/P&gt;&lt;P&gt;lv_tabix = sy-tabix + 1.&lt;/P&gt;&lt;P&gt;read table itab into wa index lv_tabix.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;now the work area wa will have the next record.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**//here you can do your processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 10:57:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415221#M199777</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-22T10:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: access next element inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415222#M199778</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;If index + 1 does not exist then it will return &lt;/P&gt;&lt;P&gt;SY_SUBRC &amp;lt;&amp;gt; 0&lt;/P&gt;&lt;P&gt;i.e&lt;/P&gt;&lt;P&gt;SY-SUBRC = 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sameena&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: sameena attarwala&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 10:59:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415222#M199778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-22T10:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: access next element inside the loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415223#M199779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shah,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;first get the value of sy-tabix in a local variable i.e.&lt;/P&gt;&lt;P&gt;l_index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_itab.&lt;/P&gt;&lt;P&gt;l_index = sy-tabix.&lt;/P&gt;&lt;P&gt;l_index = l_index + 1.&lt;/P&gt;&lt;P&gt;read table t_itab index l_index.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this works for u.&lt;/P&gt;&lt;P&gt;Seema&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 11:10:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/access-next-element-inside-the-loop/m-p/1415223#M199779</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-22T11:10:46Z</dc:date>
    </item>
  </channel>
</rss>

