<?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: FOR ALL ENTRIES COMMAND in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313182#M506901</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use of FOR ALL Entries&lt;/P&gt;&lt;P&gt;Outer join can be created using this addition to the where clause in a select statement. It speeds up the performance tremendously, but the cons of using this variation are listed below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Duplicates are automatically removed from the resulting data set. Hence care should be taken that the unique key of the detail line items should be given in the select statement. &lt;/P&gt;&lt;P&gt;If the table on which the For All Entries IN clause is based is empty, all rows are selected into the destination table. Hence it is advisable to check before-hand that the first table is not empty. &lt;/P&gt;&lt;P&gt;If the table on which the For All Entries IN clause is based is very large, the performance will go down instead of improving. Hence attempt should be made to keep the table size to a moderate level. &lt;/P&gt;&lt;P&gt;Not Recommended&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            Loop at int_cntry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             Select single * from zfligh into int_fligh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; where cntry = int_cntry-cntry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Append int_fligh. &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;Recommended&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            Select * from zfligh appending table int_fligh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            For all entries in int_cntry &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            Where cntry = int_cntry-cntry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rewards if helpfull&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 May 2007 07:01:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-22T07:01:05Z</dc:date>
    <item>
      <title>FOR ALL ENTRIES COMMAND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313180#M506899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am confused as 2 wat does the FOR ALL ENTRIES command exactly do.&lt;/P&gt;&lt;P&gt;Plz help me out...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 06:57:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313180#M506899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T06:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES COMMAND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313181#M506900</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 WHERE clause of the SELECT statement has a special variant that allows you to derive conditions from the lines and columns of an internal table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ... FOR ALL ENTRIES IN &amp;lt;itab&amp;gt; WHERE &amp;lt;cond&amp;gt; ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;cond&amp;gt; may be formulated as described above. If you specify a field of the internal table &amp;lt;itab&amp;gt; as an operand in a condition, you address all lines of the internal table. The comparison is then performed for each line of the internal table. For each line, the system selects the lines from the database table that satisfy the condition. The result set of the SELECT statement is the union of the individual selections for each line of the internal table. Duplicate lines are automatically eliminated from the result set. If &amp;lt;itab&amp;gt; is empty, the addition FOR ALL ENTRIES is disregarded, and all entries are read. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table &amp;lt;itab&amp;gt; must have a structured line type, and each field that occurs in the condition &amp;lt;cond&amp;gt; must be compatible with the column of the database with which it is compared. Do not use the operators LIKE, BETWEEN, and IN in comparisons using internal table fields. You may not use the ORDER BY clause in the same SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the option FOR ALL ENTRIES to replace nested select loops by operations on internal tables. This can significantly improve the performance for large sets of selected data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 06:59:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313181#M506900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T06:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES COMMAND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313182#M506901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use of FOR ALL Entries&lt;/P&gt;&lt;P&gt;Outer join can be created using this addition to the where clause in a select statement. It speeds up the performance tremendously, but the cons of using this variation are listed below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Duplicates are automatically removed from the resulting data set. Hence care should be taken that the unique key of the detail line items should be given in the select statement. &lt;/P&gt;&lt;P&gt;If the table on which the For All Entries IN clause is based is empty, all rows are selected into the destination table. Hence it is advisable to check before-hand that the first table is not empty. &lt;/P&gt;&lt;P&gt;If the table on which the For All Entries IN clause is based is very large, the performance will go down instead of improving. Hence attempt should be made to keep the table size to a moderate level. &lt;/P&gt;&lt;P&gt;Not Recommended&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            Loop at int_cntry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             Select single * from zfligh into int_fligh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; where cntry = int_cntry-cntry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Append int_fligh. &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;Recommended&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            Select * from zfligh appending table int_fligh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            For all entries in int_cntry &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            Where cntry = int_cntry-cntry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rewards if helpfull&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 07:01:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313182#M506901</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T07:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES COMMAND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313183#M506902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you are trying to fetch data from table, we are restricting using where condition by passing the value...this is one method...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During run time, we want to restrict the data retrival based on another internal table....for that we use FOR ALL ENTRIES &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example&lt;/P&gt;&lt;P&gt;itab1 has company_code as field and have value 100 200 &amp;amp; 300&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use select * from T001 into itab2 for all entires in itab1 where bukrs = itab1-company_code....only values 100, 200 &amp;amp; 300 if exist in table t001 will be fetched.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful/..&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;Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 07:01:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313183#M506902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T07:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES COMMAND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313184#M506903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi mohit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u have selected some records from ekko into &amp;lt;itab&amp;gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then if want select records from ekpo which are related to header fields from ekko then u can use for all entries code, as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not itab[] is initial.&lt;/P&gt;&lt;P&gt;select ebeln &lt;/P&gt;&lt;P&gt;          ebelp from ekpo&lt;/P&gt;&lt;P&gt;          into &amp;lt;itab1&amp;gt;&lt;/P&gt;&lt;P&gt;          for all entries in &amp;lt;itab&amp;gt;&lt;/P&gt;&lt;P&gt;         where eblen = &amp;lt;itab-ebeln&amp;gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;seshu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 07:01:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313184#M506903</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T07:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES COMMAND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313185#M506904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;with the FOR ALL ENTRIES command u get get the data based on another internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Means based on ur selection u have filled one internal table. based on that criteria u want another filter,then u can use this command. using where command in condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reagards, &lt;/P&gt;&lt;P&gt;shardul shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 07:02:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313185#M506904</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T07:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES COMMAND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313186#M506905</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;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     SELECTING RECORDS FROM BKPF TABLE BASED ON THE CONDITION        *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;**********************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT bukrs gjahr budat belnr blart&lt;/P&gt;&lt;P&gt;       FROM bkpf INTO TABLE itab_bkpf&lt;/P&gt;&lt;P&gt;       WHERE bukrs IN s_bukrs AND&lt;/P&gt;&lt;P&gt;             gjahr EQ p_year  AND&lt;/P&gt;&lt;P&gt;             budat IN s_budat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*********************************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    SELECTING DEBIT LINE ITEMITEMS FROM BSEG FOR THE DOCUMENT        *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                  NUMBER SELECTED FROM BKPF                          *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*********************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT itab_bkpf[] IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT bukrs gjahr belnr buzei&lt;/P&gt;&lt;P&gt;         hkont shkzg wrbtr pswsl&lt;/P&gt;&lt;P&gt;         dmbtr sgtxt zuonr&lt;/P&gt;&lt;P&gt;         FROM bseg INTO TABLE itab_bseg_debit&lt;/P&gt;&lt;P&gt;         FOR ALL ENTRIES IN itab_bkpf&lt;/P&gt;&lt;P&gt;         WHERE bukrs EQ itab_bkpf-bukrs AND&lt;/P&gt;&lt;P&gt;               belnr EQ itab_bkpf-belnr AND&lt;/P&gt;&lt;P&gt;               gjahr EQ itab_bkpf-gjahr AND&lt;/P&gt;&lt;P&gt;               hkont IN s_dbacct        AND&lt;/P&gt;&lt;P&gt;               shkzg EQ c_debit         AND&lt;/P&gt;&lt;P&gt;               dmbtr IN s_amt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can use FOR ALL ENTRIES command&lt;/P&gt;&lt;P&gt;in this way.&lt;/P&gt;&lt;P&gt;Using this we can select records depending&lt;/P&gt;&lt;P&gt;on the first select statement.&lt;/P&gt;&lt;P&gt;Use to avoid Join condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward for useful answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Regards,&lt;/P&gt;&lt;P&gt;Jackie.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 07:03:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313186#M506905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T07:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES COMMAND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313187#M506906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi mohit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab1 -- we r having some records from pa0001&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in itab2 we hav to select the join date for all the employees who are in itab1.&lt;/P&gt;&lt;P&gt;then instead of using a this way....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1&lt;/P&gt;&lt;P&gt;     select *&lt;/P&gt;&lt;P&gt;end loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we can use FOR ALL ENTRIES like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if itab1[] is not initial.&lt;/P&gt;&lt;P&gt; select pernr begda&lt;/P&gt;&lt;P&gt;           from pa0002&lt;/P&gt;&lt;P&gt;           for all entries in itab1&lt;/P&gt;&lt;P&gt;           into table itab2&lt;/P&gt;&lt;P&gt;           where pernr eq itab1-pernr.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reply back for any more clarifications..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with reagrds,&lt;/P&gt;&lt;P&gt;S.barani&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        S BHARANIDARAN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 07:07:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313187#M506906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T07:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: FOR ALL ENTRIES COMMAND</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313188#M506907</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;1) For all entries is used when you have to fetch the data from a DB table based &lt;/P&gt;&lt;P&gt;    on the values of an itab.&lt;/P&gt;&lt;P&gt;2) Suppose u hv selected particular MATNR values from MARA and now for these &lt;/P&gt;&lt;P&gt;    material number u hv to get the some filed from MARC u can user FOR ALL &lt;/P&gt;&lt;P&gt;    ENTRIES in ITAB_MARA.&lt;/P&gt;&lt;P&gt;3) FOR ALL ENTRIES resuces select query in nested loops&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sandeep&lt;/P&gt;&lt;P&gt;Reward if useful &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 07:07:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-command/m-p/2313188#M506907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T07:07:39Z</dc:date>
    </item>
  </channel>
</rss>

