<?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 within loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091077#M978256</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"Standard function module be stopped from giving MESSAGES"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most likely not.  Unless you are willing to change standard SAP code, which means pain with SPAU with every support pack upgrade.  Rather, why not just ignore it?  If you are writing a customized program, just ignore it if you don't care for the messages.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jun 2008 21:13:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-27T21:13:15Z</dc:date>
    <item>
      <title>Select within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091071#M978250</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;how good it would be to use SELECT within a loop endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it may sound stupid but can any standard function module be stopped from giving MESSAGES.?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 21:01:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091071#M978250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T21:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Select within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091072#M978251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if u dont bother about performance then go for it,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but its not at all gud to use select with in loop&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 21:03:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091072#M978251</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T21:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Select within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091073#M978252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its better use READ TABLE into the LOOP ... ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 21:05:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091073#M978252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T21:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Select within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091074#M978253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;with selects you have to look at it from the DB side.  If you do a internal table loop and a single single row from DB every time, then the program will not be designed to scale.  If instead, you do an internal loop but a select that retrieves multiple rows from the DB, you should be ok. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either way, you don't want to select too small or too much data from the DB at once.  Too small = too much overhead, inefficient.  Too large = your ABAP memory blows up the instance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 21:06:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091074#M978253</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T21:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Select within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091075#M978254</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;&lt;STRONG&gt;how good it would be to use SELECT within a loop endloop&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;There is nothing wrong using it...but performance will be the major problem instead of that why don't you do this way instead of select do you select before the loop and try to read with in loop statement that will be good. why do you want to use select inside loop statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didnt understand your second question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 21:06:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091075#M978254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T21:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Select within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091076#M978255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if u dont bother about performance then go for it,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but its not at all gud to use select with in loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;standard function module be stopped from giving MESSAGES.?------&amp;gt; y and when u are expecting this kind of messages&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 21:08:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091076#M978255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T21:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091077#M978256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"Standard function module be stopped from giving MESSAGES"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most likely not.  Unless you are willing to change standard SAP code, which means pain with SPAU with every support pack upgrade.  Rather, why not just ignore it?  If you are writing a customized program, just ignore it if you don't care for the messages.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 21:13:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091077#M978256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T21:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Select within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091078#M978257</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;thanks for the replies. let me explain the problem in detail. its like i have 4 fields that needs to be validated and those are in a internal table or each field i have got sap stndard function modules but they give messages ands not return error code in a table like return(as in any BAPI).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for each row of the table these four fields needs to be validated, how do i do it without using select inside a loop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 21:49:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091078#M978257</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T21:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Select within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091079#M978258</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;Loop your internal table and get those 4 fields into one variable and then after the loop you do validation that will be fine right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 22:18:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091079#M978258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T22:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Select within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091080#M978259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume that your internal table is already filled with entries, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now inside the loop why do you want to use a select statement ( are you getting any more data from DB ) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using only one standard function module for each of the field validation, then go for code inside the function module ( check which tables are accessed by the FM and what conditions it might be checking and based on which it is issuing the messages, and of them you might be needing only few ) . Use this code ( except for triggering the messages, where you can substitute your own code of setting error codes or anything ) in a subroutine inside the loop. In that way you can avoid the messages. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can reply the function module you are using, let me help you with that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2008 23:21:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091080#M978259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-27T23:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091081#M978260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i think you are tryin to get information with a specific data that you hve for each loop pass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have have to use the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_table into wa_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * into wa_area&lt;/P&gt;&lt;P&gt;from transparent-table&lt;/P&gt;&lt;P&gt;where field = wa_table-field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append wa_area to it_newtable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa_area.&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;&lt;/P&gt;&lt;P&gt;but i think that process with take a log time to get at end, i think you have to have the information first into the table i_table and make a read table to the second table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop it_table into wa_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it_table2 into wa_area2 with key field = wa_table-field.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0&lt;/P&gt;&lt;P&gt;move the fields you need to new work area wa_newtable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append wa_newtable to it_newtable.&lt;/P&gt;&lt;P&gt;&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;&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;&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;&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;&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;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2008 00:23:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091081#M978260</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-28T00:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Select within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091082#M978261</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;There is nothing wrong in using SELECT within LOOP and ENDLOOP.  Here the performance issue comes into pictures because, If an internal table that ur trtying to loop had large number of records and If  you use SELECT with that loop, thnen it will try to hit the database that many times. You are trying to rectierve a record that many times from database table which increases the access time to read or write.&lt;/P&gt;&lt;P&gt;You are increasing the load on the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally, we dont use it. Instead use the READ table inside a Loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF you dont want to a function module to throw messages then dont handle exceptions in it.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;One more thing, Some of the BAPI funciton modules doesnt return exceptions insted they will handle errors in RETURN structure ie BAPIRETURN type.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here we can process the errors but not the exceptions.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Wishes,&lt;/P&gt;&lt;P&gt;Chandralekha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2008 03:50:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091082#M978261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-28T03:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Select within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091083#M978262</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 you want to retrieve records from table according to the internal table values then its better to use for all entries of i_itab in select statement. Within the  select query only you can check the condition( Validating the fields ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajitha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2008 03:52:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091083#M978262</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-28T03:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Select within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091084#M978263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;There is no harm in using SELECT statement inside a LOOP and ENDLOOP statement. Performance is an issue with this option. Using SELECT statement will hit the database several times. Hence you have to be careful of performance while using SELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if Useful&lt;/P&gt;&lt;P&gt;Sumit Agarwal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2008 04:22:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091084#M978263</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-28T04:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Select within loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091085#M978264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there any exception using for Bufferred tables with in loops?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 18:14:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-within-loop/m-p/4091085#M978264</guid>
      <dc:creator>former_member637135</dc:creator>
      <dc:date>2014-01-06T18:14:52Z</dc:date>
    </item>
  </channel>
</rss>

