<?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: SubQuerry Not being executed in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/subquerry-not-being-executed/m-p/8306052#M1636095</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to hold the subquery value, then you have to split it in two separate queries. As BreakPoint said, the subquery is not intented to change any variables, but to check existence of values in other table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Dec 2011 13:11:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-12-05T13:11:45Z</dc:date>
    <item>
      <title>SubQuerry Not being executed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subquerry-not-being-executed/m-p/8306047#M1636090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gentelmen;&lt;/P&gt;&lt;P&gt;I have posted this question in the Test and Playground Forum but no one has responded.&lt;/P&gt;&lt;P&gt;Any of you experts in this forum may be able to help me please...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this problem where I am selecting records to display on the report from table customer and trying to count how many booking are there for each customer in booking table based on the customer id from booking table.&lt;/P&gt;&lt;P&gt;here is my query code below...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select id name city custtype discount into (wa-scid, wa-scname, wa-sccity, wa-scctype, wa-scdisc) from customer

  where city = 'CityName' and
  country = 'CountryName' and exists ( 
  select count( distinct custid ) as wa-cnt from bookings group by custid ).

  WRITE: /1 wa-scid, 11 wa-scname, 40 wa-sccity, 70 wa-scctype, 78 wa-scdisc,'%', 90 wa-cnt.

  endselect.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to debug the issue and seems like the sub query is not being executed. The reason i say that because the value  of wa-cnt which is a counter of type i is not changing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any one can shed some light in this matter/problem please...&lt;/P&gt;&lt;P&gt;Many Thanks.&lt;/P&gt;&lt;P&gt;-hisheeraz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Dec 2011 12:37:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subquerry-not-being-executed/m-p/8306047#M1636090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-03T12:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: SubQuerry Not being executed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subquerry-not-being-executed/m-p/8306048#M1636091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are using AS addition in the subquery to determine whether the subquery is being executed or not, and I think this is wrong. AS addition has only meaning when your using wither INTO or APPENDING, it wouldn't change the value of wa-cnt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you to try to change the subquery to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;and exists ( select count( * ) from bookings ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you're using only the COUNT aggregation expression int the subquery, a GROUPING is not necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Dec 2011 19:20:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subquerry-not-being-executed/m-p/8306048#M1636091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-04T19:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: SubQuerry Not being executed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subquerry-not-being-executed/m-p/8306049#M1636092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;why dont you just break it down to two queries?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 05:54:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subquerry-not-being-executed/m-p/8306049#M1636092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-05T05:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: SubQuerry Not being executed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subquerry-not-being-executed/m-p/8306050#M1636093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply Julio Almeida 	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that syntax of yours is good and i tried that already before your reply but my problem is i have no idea how can i place the value of that count into something ( a variable ) to display on the report screen. or if i donot hold that count(&lt;STRONG&gt;) value to a variable then how can i display that subquery count(&lt;/STRONG&gt;) value on the report.&lt;/P&gt;&lt;P&gt;could you assist in this matter further please ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Soumyaprakash M... 	having two querries works and give me the required result but i am not allowed to do so in that order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks heaps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 10:38:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subquerry-not-being-executed/m-p/8306050#M1636093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-05T10:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: SubQuerry Not being executed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subquerry-not-being-executed/m-p/8306051#M1636094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;read your documentation on subquery or see tips and tricks in SE30.  You cannot retain any values from that subquery....subqueries are intended to check only the existence (or does not exist) of a value or condition in a separate table, as part of the decision process to retain (or drop) values from the first table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; This is much faster than FAEI (For all entries in) or JOIN, but has this particular limitation!...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 13:07:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subquerry-not-being-executed/m-p/8306051#M1636094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-05T13:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: SubQuerry Not being executed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subquerry-not-being-executed/m-p/8306052#M1636095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to hold the subquery value, then you have to split it in two separate queries. As BreakPoint said, the subquery is not intented to change any variables, but to check existence of values in other table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 13:11:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subquerry-not-being-executed/m-p/8306052#M1636095</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-05T13:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: SubQuerry Not being executed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/subquerry-not-being-executed/m-p/8306053#M1636096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to all the experts who answered and tried to contribute towards my solution. regards.&lt;/P&gt;&lt;P&gt;-hisheeraz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 14:19:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/subquerry-not-being-executed/m-p/8306053#M1636096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-05T14:19:15Z</dc:date>
    </item>
  </channel>
</rss>

