<?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: select into table within loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995732#M954616</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;thank you so much. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i use hoffman suggestion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Jun 2008 12:46:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-17T12:46:47Z</dc:date>
    <item>
      <title>select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995722#M954606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;may i know if every loop those can map records from bsad can be added into table it_temp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_itab where umskz = 'W'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select bukrs belnr gjahr buzei&lt;/P&gt;&lt;P&gt;into table it_temp&lt;/P&gt;&lt;P&gt;from bsad&lt;/P&gt;&lt;P&gt;where bukrs = it_itab-bukrs.&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;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 12:37:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995722#M954606</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T12:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995723#M954607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use APPENDING TABLE instead of INTO TABLE.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 12:40:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995723#M954607</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-06-17T12:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995724#M954608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat n&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 12:41:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995724#M954608</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T12:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995725#M954609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can write your code like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_itab where umskz = 'W'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select bukrs belnr gjahr buzei&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;appending&lt;/STRONG&gt; table it_temp&lt;/P&gt;&lt;P&gt;from bsad&lt;/P&gt;&lt;P&gt;where bukrs = it_itab-bukrs.&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;&lt;/P&gt;&lt;P&gt;But note that this is nota good programming practice(Select within a loop).&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>Tue, 17 Jun 2008 12:41:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995725#M954609</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T12:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995726#M954610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;Select inside a loop causes performance issue. 

Instead of that 
declare itab1 similar to itab.
loop at it_itab into wa_itab.
if wa_itam-umskz = 'W'.
move wa_itab to wa_itab1.
append wa_itab1 to it_itab1.
endif. 
endloop.

select bukrs belnr gjahr buzei
into table it_temp
from bsad
for all entries in it_itab1
where bukrs = it_itab1-bukrs.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kannaiah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 12:43:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995726#M954610</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T12:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995727#M954611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hiiii...instead of using select with in loop....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use for all entries statement that would give a better performance and solve the problem ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards &lt;/P&gt;&lt;P&gt;chandu reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 12:43:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995727#M954611</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T12:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995728#M954612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess this way would be better:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Select BUKRS BELNR GJAHR BUZEI
INTO TABLE IT_TEMP
FROM BSAD
FOR ALL ENTRIES IN IT_TAB
WHERE BUKRS = IT_TAB-BUKRS
  AND IT_TAB-UMSKZ = 'W'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Chandu said, in many cases it will improve the performance and give you a clearer code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tips for performance and code clearing: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Sort your internal table by the key fields used for the comparisons on "Where" statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- If you think your comparison key values on IT_TAB will repeat many times, create an auxiliar table with just one entry of each value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 12:43:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995728#M954612</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T12:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995729#M954613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hiii&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use following type of query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT carrid connid cityfrom cityto 
       FROM spfli 
       INTO (wa-carrid, wa-connid, wa-cityfrom, wa-cityto). 
  WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto. 
ENDSELECT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or else you can use &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;... INTO|APPENDING [CORRESPONDING FIELDS OF] TABLE itab [PACKAGE SIZE n]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syntax for appending internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;&lt;P&gt;twinkal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 12:44:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995729#M954613</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T12:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995730#M954614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt; once getiing data into ur internal table it_tab. &lt;/P&gt;&lt;P&gt;write the second select stmt using &lt;STRONG&gt;For All Entries&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt; select ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not it_tab is initial.&lt;/P&gt;&lt;P&gt; select ...... into it_ttab1 for all  entries in it_tab where.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds.,&lt;/P&gt;&lt;P&gt;subash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 12:44:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995730#M954614</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T12:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995731#M954615</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;don't use any DDL and DML statement within the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anyway, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the it_temp will get last record only. if you want all the data use the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_itab where umskz = 'W'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select bukrs belnr gjahr buzei&lt;/P&gt;&lt;P&gt;appending table it_temp&lt;/P&gt;&lt;P&gt;from bsad&lt;/P&gt;&lt;P&gt;where bukrs = it_itab-bukrs.&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;try to avoid the select statement within the loop.&lt;/P&gt;&lt;P&gt;Reward if found helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Boobalan Suburaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 12:45:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995731#M954615</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T12:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995732#M954616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;thank you so much. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i use hoffman suggestion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 12:46:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995732#M954616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T12:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995733#M954617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of LOOPs, try using FOR ALL ENTRIES IN.&lt;/P&gt;&lt;P&gt;Doing so, you'll improve the performance.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT bukrs belnr gjahr buzei
INTO TABLE it_temp
FROM bsad
FOR ALL ENTRIES IN it_itab
WHERE bukrs = it_itab-bukrs.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brian Gonsales&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 12:50:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995733#M954617</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T12:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995734#M954618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi hoffman,&lt;/P&gt;&lt;P&gt;actually it doesn't work.&lt;/P&gt;&lt;P&gt;the statement &lt;/P&gt;&lt;P&gt;it_itab-umskz = 'W' &lt;/P&gt;&lt;P&gt;is unknown to system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 13:02:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995734#M954618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T13:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995735#M954619</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;IT_TAB1 =IT_TAB.&lt;/P&gt;&lt;P&gt;delete IT_TAB where umskz &amp;lt;&amp;gt; 'W'.&lt;/P&gt;&lt;P&gt;if you want other rec. take the copy of itab to itab1. otherwise leave it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select BUKRS BELNR GJAHR BUZEI&lt;/P&gt;&lt;P&gt;INTO TABLE IT_TEMP&lt;/P&gt;&lt;P&gt;FROM BSAD&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN IT_TAB&lt;/P&gt;&lt;P&gt;WHERE BUKRS = IT_TAB-BUKRS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if found helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Boobalan Suburaj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Boobalan Suburaj on Jun 17, 2008 4:07 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 13:07:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995735#M954619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T13:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995736#M954620</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;define another internal table and copy all data into it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;itab2[] = itab[].&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete all lines where umskz is not W:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DELETE itab2 WHERE umskz NE 'W'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you can do your select:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT bukrs belnr gjahr buzei
INTO TABLE it_temp
FROM bsad
FOR ALL ENTRIES IN itab2
WHERE bukrs = itab2-bukrs&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;ec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 13:10:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995736#M954620</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-06-17T13:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: select into table within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995737#M954621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;the problem is here &lt;/P&gt;&lt;P&gt;AND IT_TAB-UMSKZ = 'W'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i guess it_tab field cannot declare here as this is for bsad field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if we declare something like umskz = it_tab-umskz, then it is ok. so you see the different position?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select BUKRS BELNR GJAHR BUZEI&lt;/P&gt;&lt;P&gt;INTO TABLE IT_TEMP&lt;/P&gt;&lt;P&gt;FROM BSAD&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN IT_TAB&lt;/P&gt;&lt;P&gt;WHERE BUKRS = IT_TAB-BUKRS&lt;/P&gt;&lt;P&gt;AND IT_TAB-UMSKZ = 'W'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2008 13:11:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-into-table-within-loop/m-p/3995737#M954621</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-17T13:11:20Z</dc:date>
    </item>
  </channel>
</rss>

