<?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: loop at internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-internal-table/m-p/1114066#M106955</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it is needed, yes it is ok to use it. But typically you use the select option to select from the database table and then all your entries in the internal table will satisfy that condition, so you don't need to use it in the where clause of the loop statement again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM maraA INTO TABLE itab WHERE matnr IN so_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here all the records will satisfy the condition for the select option already.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you have code like this for some reason,&lt;/P&gt;&lt;P&gt;SELECT * FROM mara INTO TABLE itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you need to use the select option in your loop statement as you did in your example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Feb 2006 15:51:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-02-12T15:51:25Z</dc:date>
    <item>
      <title>loop at internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-internal-table/m-p/1114065#M106954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I am fairly new to ABAP. I have a small doubt which requires your help. I wan to know if the following statement is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at g_t_data where matnr in so_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so_matnr is a select option for mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to know if it is correct to use a select option after the where clause. I tried using it, and I didnt get any syntax error. I want to know if it is a right programming practice to do so.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Feb 2006 15:45:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-internal-table/m-p/1114065#M106954</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-12T15:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: loop at internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-internal-table/m-p/1114066#M106955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it is needed, yes it is ok to use it. But typically you use the select option to select from the database table and then all your entries in the internal table will satisfy that condition, so you don't need to use it in the where clause of the loop statement again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM maraA INTO TABLE itab WHERE matnr IN so_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here all the records will satisfy the condition for the select option already.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you have code like this for some reason,&lt;/P&gt;&lt;P&gt;SELECT * FROM mara INTO TABLE itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you need to use the select option in your loop statement as you did in your example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Feb 2006 15:51:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-internal-table/m-p/1114066#M106955</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-12T15:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: loop at internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-internal-table/m-p/1114067#M106956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Srinivas. As you have mentioned, I was unable to use the where clause on so_matnr in my select statement because I had used an outer join to join tables, and so I couldnt use any fields from the table on the right hand side of the outer join in my select statement. That is the reason I had to use it in the loop at &amp;lt;itab&amp;gt; statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Feb 2006 16:00:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-internal-table/m-p/1114067#M106956</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-12T16:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: loop at internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-internal-table/m-p/1114068#M106957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I said, in such cases, you can use it in the where clause. But another better way to do may be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE itab WHERE matnr in so_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way you can delete all the unwanted material records from your itab and then simply use the loop statement without the where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please close the post if answered,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Feb 2006 16:03:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-internal-table/m-p/1114068#M106957</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-12T16:03:18Z</dc:date>
    </item>
  </channel>
</rss>

