<?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: query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1583026#M262953</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Kindly check the &amp;lt;b&amp;gt;syntax&amp;lt;/b&amp;gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... FOR ALL ENTRIES IN itab WHERE ... col operator itab-comp ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table itab must have a &amp;lt;b&amp;gt;structured line type&amp;lt;/b&amp;gt; and the component comp must be &lt;/P&gt;&lt;P&gt;compatible with the column col. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logical expression sql_cond of the WHERE condition can comprise various &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;logical expressions&amp;lt;/b&amp;gt; by using AND and OR. However, if FOR ALL ENTRIES is specified, &lt;/P&gt;&lt;P&gt;there must be at least one Comparison with a column of the internal table itab, &lt;/P&gt;&lt;P&gt;which can be specified either statistically or dynamically (Release 6.40 and higher). &lt;/P&gt;&lt;P&gt;In a statement with a SELECT statement with FOR ALL ENTRIES, the addition ORDER BY &lt;/P&gt;&lt;P&gt;can only be used with the addition PRIMARY KEY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The whole logical expression sql_cond is evaluated for each individual line of the &lt;/P&gt;&lt;P&gt;internal table itab. The resulting set of the SELECT statement is the union of &lt;/P&gt;&lt;P&gt;the resulting sets from the individual evaluations.&lt;/P&gt;&lt;P&gt;Duplicate lines are automatically removed from the resulting set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the internal table itab &amp;lt;b&amp;gt;is empty&amp;lt;/b&amp;gt;, the whole WHERE statement is ignored and &lt;/P&gt;&lt;P&gt;all lines in the database are put in the resulting set.&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;best regards,&lt;/P&gt;&lt;P&gt;Thangesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Oct 2006 13:44:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-09T13:44:19Z</dc:date>
    <item>
      <title>query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1583024#M262951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what precaution need to be taken while using the query&lt;/P&gt;&lt;P&gt;select.....forallentries.......&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2006 13:39:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1583024#M262951</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-09T13:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1583025#M262952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check if your internal table is not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not itab[] is initial.&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from &amp;lt;table&amp;gt;&lt;/P&gt;&lt;P&gt;into table it_final&lt;/P&gt;&lt;P&gt;for all entries in itab&lt;/P&gt;&lt;P&gt;where....&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2006 13:41:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1583025#M262952</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-09T13:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1583026#M262953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Kindly check the &amp;lt;b&amp;gt;syntax&amp;lt;/b&amp;gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... FOR ALL ENTRIES IN itab WHERE ... col operator itab-comp ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table itab must have a &amp;lt;b&amp;gt;structured line type&amp;lt;/b&amp;gt; and the component comp must be &lt;/P&gt;&lt;P&gt;compatible with the column col. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logical expression sql_cond of the WHERE condition can comprise various &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;logical expressions&amp;lt;/b&amp;gt; by using AND and OR. However, if FOR ALL ENTRIES is specified, &lt;/P&gt;&lt;P&gt;there must be at least one Comparison with a column of the internal table itab, &lt;/P&gt;&lt;P&gt;which can be specified either statistically or dynamically (Release 6.40 and higher). &lt;/P&gt;&lt;P&gt;In a statement with a SELECT statement with FOR ALL ENTRIES, the addition ORDER BY &lt;/P&gt;&lt;P&gt;can only be used with the addition PRIMARY KEY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The whole logical expression sql_cond is evaluated for each individual line of the &lt;/P&gt;&lt;P&gt;internal table itab. The resulting set of the SELECT statement is the union of &lt;/P&gt;&lt;P&gt;the resulting sets from the individual evaluations.&lt;/P&gt;&lt;P&gt;Duplicate lines are automatically removed from the resulting set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the internal table itab &amp;lt;b&amp;gt;is empty&amp;lt;/b&amp;gt;, the whole WHERE statement is ignored and &lt;/P&gt;&lt;P&gt;all lines in the database are put in the resulting set.&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;best regards,&lt;/P&gt;&lt;P&gt;Thangesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2006 13:44:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1583026#M262953</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-09T13:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1583027#M262954</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;case 1.&lt;/P&gt;&lt;P&gt;Select * from a&lt;/P&gt;&lt;P&gt;        into it_a&lt;/P&gt;&lt;P&gt;        where &amp;lt;&amp;gt;.&lt;/P&gt;&lt;P&gt; if sy-subrc = 0.&lt;/P&gt;&lt;P&gt; Select * from b&lt;/P&gt;&lt;P&gt;        into it_b&lt;/P&gt;&lt;P&gt;        for all entries in it_a&lt;/P&gt;&lt;P&gt;        where &amp;lt;&amp;gt;.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case2.&lt;/P&gt;&lt;P&gt;Select * from a&lt;/P&gt;&lt;P&gt;        into it_a&lt;/P&gt;&lt;P&gt;        where &amp;lt;&amp;gt;.&lt;/P&gt;&lt;P&gt; if not it_a[] is initial.&lt;/P&gt;&lt;P&gt; Select * from b&lt;/P&gt;&lt;P&gt;        into it_b&lt;/P&gt;&lt;P&gt;        for all entries in it_a&lt;/P&gt;&lt;P&gt;        where &amp;lt;&amp;gt;.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;if you miss those checks then you will endup with full database fetch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2006 13:48:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1583027#M262954</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-09T13:48:27Z</dc:date>
    </item>
  </channel>
</rss>

