<?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 in select clause in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-in-select-clause/m-p/3758216#M904139</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vinay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  For all entries is used to retrieve data from two or more tables.&lt;/P&gt;&lt;P&gt;In some cases , one of the table may be a cluster table .So we can't use the inner or outer join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For &lt;STRONG&gt;example&lt;/STRONG&gt; we have invoice details in VBRK and condition values in KONV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we can fetch invoice details in one internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select vbeln fkdat knumv posnr from vbrk &lt;/P&gt;&lt;P&gt;into table it_vbrk where vbeln in so_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The corresponding condition values for the invoices can be fetched from KONV table by writing a query with for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select knumv Kposn kschl kwert from konv &lt;/P&gt;&lt;P&gt;in to table it_konv for all entries in it_vbrk-vbeln &lt;/P&gt;&lt;P&gt;where knumv  eq it_vbrk-knumv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Charumathi.B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 May 2008 09:08:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-02T09:08:20Z</dc:date>
    <item>
      <title>for all entries in select clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-in-select-clause/m-p/3758211#M904134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for all entries in select clause,can u tell use of this one?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 08:48:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-in-select-clause/m-p/3758211#M904134</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T08:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: for all entries in select clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-in-select-clause/m-p/3758212#M904135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select * from MARA&lt;/P&gt;&lt;P&gt;into table IT_MARA&lt;/P&gt;&lt;P&gt;for all entries in it_matnr&lt;/P&gt;&lt;P&gt;wheren matnr = it_matnr-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In table IT_MATNR there are for example 10 materials entered.&lt;/P&gt;&lt;P&gt;Now for all these materials (FOR ALL ENTRIES IN IT_MATNR)&lt;/P&gt;&lt;P&gt;we want to retrieve the data from DB TABLE MARA and put them into another internal table IT_MARA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Micky Oestreich on May 2, 2008 10:51 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 08:51:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-in-select-clause/m-p/3758212#M904135</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2008-05-02T08:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: for all entries in select clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-in-select-clause/m-p/3758213#M904136</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;Use of FOR ALL Entries&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;. &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;&lt;STRONG&gt;Recommended&lt;/STRONG&gt;&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;            &lt;STRONG&gt;For all entries in int_cntry&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            &lt;STRONG&gt;Where cntry = int_cntry-cntry.&lt;/STRONG&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;    You can only use FOR ALL ENTRIES IN ...WHERE ...in a SELECT statement.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT ... FOR ALL ENTRIES IN itab WHERE cond returns the union of the solution sets of all SELECT &lt;/P&gt;&lt;P&gt;    statements that would result if you wrote a separate statement for each line of the internal table replacing the symbol &lt;/P&gt;&lt;P&gt;    itab-f with the corresponding value of component f in the WHERE condition.Duplicates are discarded from the result  &lt;/P&gt;&lt;P&gt;    set. If the internal table itab does not contain any entries, the system treats the statement as though there were  &lt;/P&gt;&lt;P&gt;    no WHERE cond condition, and selects all records (in the current client).  &lt;/P&gt;&lt;P&gt;    for example: &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;       *SELECT * FROM sflight INTO wa_sflight*&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;                 &lt;STRONG&gt;FOR ALL ENTRIES IN ftab&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;                 &lt;STRONG&gt;WHERE CARRID = ftab-carrid AND&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;                  &lt;STRONG&gt;CONNID = ftab-connid AND&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;                         &lt;STRONG&gt;fldate = '20010228'.&lt;/STRONG&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    this condition, return all entries of the sflight  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;REWARD IF HELPFUL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PRASANTH&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 08:52:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-in-select-clause/m-p/3758213#M904136</guid>
      <dc:creator>prasanth_kasturi</dc:creator>
      <dc:date>2008-05-02T08:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: for all entries in select clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-in-select-clause/m-p/3758214#M904137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select * from table into internal_table&lt;/P&gt;&lt;P&gt;for all entries in Itab1&lt;/P&gt;&lt;P&gt;where conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But before using FOR ALL ENTRIES make sure the itab1 which you are using shoul not be blank, otherwise it will fetch all the entries from Database table which can cause the dump or can affect the performance of the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards if helps...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 08:57:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-in-select-clause/m-p/3758214#M904137</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T08:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: for all entries in select clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-in-select-clause/m-p/3758215#M904138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Vinay,&lt;/P&gt;&lt;P&gt;For all entries is replacement for Joins. What it will do is it will select all the records for all entries in specified table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some mandatory checks has to be done before using this. Else u will get unexpected results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Check Driver table is initial or not. If driver table is initial then it will select all the records from the data base. So this is mandatory check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Sort and delete duplicates based on where clause fields to improve performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Where clause fields of driver and driven tables field type and length must be same. Else u will get syntax error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. At least one field from for all entries in table must exist in where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT i_mara BY matnr.&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES FROM i_mara COMPARING matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHECK NOT i_mara[] IS INITIAL.&lt;/P&gt;&lt;P&gt;SELECT * FROM lips &lt;/P&gt;&lt;P&gt;INTO TABLE i_lips&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN i_mara&lt;/P&gt;&lt;P&gt;WHERE vbeln IN so_vbeln&lt;/P&gt;&lt;P&gt;AND matnr EQ i_mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 08:59:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-in-select-clause/m-p/3758215#M904138</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-05-02T08:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: for all entries in select clause</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-in-select-clause/m-p/3758216#M904139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vinay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  For all entries is used to retrieve data from two or more tables.&lt;/P&gt;&lt;P&gt;In some cases , one of the table may be a cluster table .So we can't use the inner or outer join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For &lt;STRONG&gt;example&lt;/STRONG&gt; we have invoice details in VBRK and condition values in KONV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we can fetch invoice details in one internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select vbeln fkdat knumv posnr from vbrk &lt;/P&gt;&lt;P&gt;into table it_vbrk where vbeln in so_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The corresponding condition values for the invoices can be fetched from KONV table by writing a query with for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select knumv Kposn kschl kwert from konv &lt;/P&gt;&lt;P&gt;in to table it_konv for all entries in it_vbrk-vbeln &lt;/P&gt;&lt;P&gt;where knumv  eq it_vbrk-knumv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Charumathi.B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 09:08:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/for-all-entries-in-select-clause/m-p/3758216#M904139</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T09:08:20Z</dc:date>
    </item>
  </channel>
</rss>

