<?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 SELECT QUERY in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3557954#M856124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am doing an select like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; FROM bsak&lt;/P&gt;&lt;P&gt;INTO TABLE t_cleared&lt;/P&gt;&lt;P&gt; FOR ALL ENTRIES IN t_data1&lt;/P&gt;&lt;P&gt; WHERE lifnr = t_data1-lifnr&lt;/P&gt;&lt;P&gt; AND  bukrs IN s_bukrs&lt;/P&gt;&lt;P&gt; AND  augdt GT p_kdate&lt;/P&gt;&lt;P&gt; AND  belnr NE bsik-augbl&lt;/P&gt;&lt;P&gt; AND  budat LE p_kdate&lt;/P&gt;&lt;P&gt; AND  bschl = 31.&lt;/P&gt;&lt;P&gt;  AND  hkont IN s_hkont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now the problem is that the table t_data1 has got no records for this particular case and moreover for the particular s_hkont and bukrs combination there are no  records in the table but still this select is fetching all the records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wat is wrong here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Apr 2008 18:13:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-01T18:13:30Z</dc:date>
    <item>
      <title>SELECT QUERY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3557954#M856124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am doing an select like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; FROM bsak&lt;/P&gt;&lt;P&gt;INTO TABLE t_cleared&lt;/P&gt;&lt;P&gt; FOR ALL ENTRIES IN t_data1&lt;/P&gt;&lt;P&gt; WHERE lifnr = t_data1-lifnr&lt;/P&gt;&lt;P&gt; AND  bukrs IN s_bukrs&lt;/P&gt;&lt;P&gt; AND  augdt GT p_kdate&lt;/P&gt;&lt;P&gt; AND  belnr NE bsik-augbl&lt;/P&gt;&lt;P&gt; AND  budat LE p_kdate&lt;/P&gt;&lt;P&gt; AND  bschl = 31.&lt;/P&gt;&lt;P&gt;  AND  hkont IN s_hkont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now the problem is that the table t_data1 has got no records for this particular case and moreover for the particular s_hkont and bukrs combination there are no  records in the table but still this select is fetching all the records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wat is wrong here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 18:13:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3557954#M856124</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T18:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT QUERY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3557955#M856125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You know the answer. t_data1 has no records..so all the records will be fetched if you use for all entries addition. It's a standard behaviour.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Execute the select query only when t_data1[] is not initial.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 18:17:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3557955#M856125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T18:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT QUERY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3557956#M856126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have to check the internal table not initial whenever we use FOR ALL ENTRIES Statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If t_data1[]  is balnk. it fetches all the record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So check for t_data1[] not inital. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT t_data1[] is INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select *&lt;/P&gt;&lt;P&gt;FROM bsak&lt;/P&gt;&lt;P&gt;INTO TABLE t_cleared&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN t_data1&lt;/P&gt;&lt;P&gt;WHERE lifnr = t_data1-lifnr&lt;/P&gt;&lt;P&gt;AND bukrs IN s_bukrs&lt;/P&gt;&lt;P&gt;AND augdt GT p_kdate&lt;/P&gt;&lt;P&gt;AND belnr NE bsik-augbl&lt;/P&gt;&lt;P&gt;AND budat LE p_kdate&lt;/P&gt;&lt;P&gt;AND bschl = 31.&lt;/P&gt;&lt;P&gt;AND hkont IN s_hkont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 20:36:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3557956#M856126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T20:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: SELECT QUERY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3557957#M856127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cant fetch any data from a select stm if there arent values on t_data1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please fisrt check if there are values....&lt;/P&gt;&lt;P&gt;ie:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBRE TABLE t_data1 LINES num.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if num &amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;YOUR CODE&amp;gt;&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;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gabriel P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Apr 2008 23:30:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3557957#M856127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-01T23:30:03Z</dc:date>
    </item>
  </channel>
</rss>

