<?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 ... for all entries problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-for-all-entries-problem/m-p/3797195#M913283</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot!! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added BUZEI to the select statement and that solved the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your answers were very helpful!!&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, 13 May 2008 14:42:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-13T14:42:54Z</dc:date>
    <item>
      <title>select ... for all entries problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-for-all-entries-problem/m-p/3797192#M913280</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;I'm making select statements to BKPF and BSEG, but I can't do an inner join between this two table because BSEG it's a cluster table so I have to do a SELECT... FOR ALL ENTRIES, but in SE16 I make the same query that I have writen in my program as shown below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT BUKRS BELNR GJAHR BUDAT MONAT&lt;/P&gt;&lt;P&gt;FROM BKPF INTO CORRESPONDING FIELDS OF TABLE it_bkpf &lt;/P&gt;&lt;P&gt;WHERE  BUKRS  = 'XXX'&lt;/P&gt;&lt;P&gt;AND        GJAHR  = '2005'&lt;/P&gt;&lt;P&gt;AND        BELNR  = '0000000250'. "just for proof&lt;/P&gt;&lt;P&gt;AND        MONAT = '10'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above query returns me 1 row in program and in SE16 and then I make the next query for BSEG to do the join&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT BUKRS BELNR GJAHR BSCHL SHKZG WRBTR HKONT&lt;/P&gt;&lt;P&gt;FROM BSEG INTO CORRESPONDING FIELDS OF TABLE IT_BSEG&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN it_bkpf&lt;/P&gt;&lt;P&gt;WHERE bukrs = it_bkpf-bukrs&lt;/P&gt;&lt;P&gt;and gjahr = it_bkpf-gjahr&lt;/P&gt;&lt;P&gt;and belnr = it_bkpf-belnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this query returns 897 rows and in SE16 this same query returns 901 rows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why SELECT...FOR ALL ENTRIES brings me less rows affected by the query in SE16&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2008 01:12:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-for-all-entries-problem/m-p/3797192#M913280</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-13T01:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: select ... for all entries problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-for-all-entries-problem/m-p/3797193#M913281</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;The reason you are getting the less data is you haven't selected all the key fields from the table.&lt;/P&gt;&lt;P&gt;Change your query to include BUZEI in the selection from BSEG as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT BUKRS BELNR GJAHR &lt;STRONG&gt;BUZEI&lt;/STRONG&gt; BSCHL SHKZG WRBTR HKONT&lt;/P&gt;&lt;P&gt;FROM BSEG INTO CORRESPONDING FIELDS OF TABLE IT_BSEG&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN it_bkpf&lt;/P&gt;&lt;P&gt;WHERE bukrs = it_bkpf-bukrs&lt;/P&gt;&lt;P&gt;and gjahr = it_bkpf-gjahr&lt;/P&gt;&lt;P&gt;and belnr = it_bkpf-belnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2008 01:46:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-for-all-entries-problem/m-p/3797193#M913281</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-13T01:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: select ... for all entries problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-for-all-entries-problem/m-p/3797194#M913282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Please use the following code for selcting the exact number of rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF it_bkpf[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;  SELECT *&lt;/P&gt;&lt;P&gt;  FROM BSEG INTO CORRESPONDING FIELDS OF   TABLE    IT_BSEG&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN it_bkpf&lt;/P&gt;&lt;P&gt;WHERE bukrs = it_bkpf-bukrs&lt;/P&gt;&lt;P&gt;and gjahr = it_bkpf-gjahr&lt;/P&gt;&lt;P&gt;and belnr = it_bkpf-belnr.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of * ,you can specify the exact fields required along with all the key fields as selection fields.Also it is must to check the condition it_bkpf[] IS NOT INITIAL before using the statement FOR ALL ENTRIES IN it_bkpf.Suppose if this condition is not used and if it_bkpf is initial,it will fetch all entries from the table.&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;Regards,&lt;/P&gt;&lt;P&gt;Aravind&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2008 02:51:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-for-all-entries-problem/m-p/3797194#M913282</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-13T02:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: select ... for all entries problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-for-all-entries-problem/m-p/3797195#M913283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot!! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added BUZEI to the select statement and that solved the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your answers were very helpful!!&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, 13 May 2008 14:42:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-for-all-entries-problem/m-p/3797195#M913283</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-13T14:42:54Z</dc:date>
    </item>
  </channel>
</rss>

