<?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 count(*) from in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117531#M1187008</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mahesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try it now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Graham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Feb 2009 09:23:19 GMT</pubDate>
    <dc:creator>glittle_tjc</dc:creator>
    <dc:date>2009-02-02T09:23:19Z</dc:date>
    <item>
      <title>select count(*) from</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117519#M1186996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use the following statements to obtain the number of entries in a db table matching my criteria:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:        lv_extractrows TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT  COUNT(*) FROM (P_TABNAME) BYPASSING BUFFER&lt;/P&gt;&lt;P&gt;    WHERE (cond_syntax).&lt;/P&gt;&lt;P&gt;  lv_extractrows = sy-dbcnt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is strange is that this works fine for large numbers of entries but when it runs with a cond_syntax that should return 2 entries it returns 0 entries...(sy-dbcnt = 0).&lt;/P&gt;&lt;P&gt;If I check in SE11 'number of entries' for cond_syntax it returns 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone say why the code works fine for 12k entries but not for 2?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 08:58:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117519#M1186996</guid>
      <dc:creator>glittle_tjc</dc:creator>
      <dc:date>2009-02-02T08:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: select count(*) from</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117520#M1186997</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;Try it this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: lv_extractrows TYPE i.

SELECT COUNT(*)
FROM (P_TABNAME)
INTO (lv_extractrows)
WHERE (cond_syntax).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Tarun Gambhir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 09:01:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117520#M1186997</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-02-02T09:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: select count(*) from</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117521#M1186998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Graham,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the value in &lt;STRONG&gt;cond_syntax&lt;/STRONG&gt; at run-time for which it is giving an error ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you share this detail with us?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 09:04:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117521#M1186998</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-02-02T09:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: select count(*) from</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117522#M1186999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tarun&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the code - I already tried this way originally but it doesn't work either.&lt;/P&gt;&lt;P&gt;I changed it to the way above after looking at the code in SE11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is the select doesn't return the value 2 (it returns sy-dbcnt = 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Graham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 09:06:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117522#M1186999</guid>
      <dc:creator>glittle_tjc</dc:creator>
      <dc:date>2009-02-02T09:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: select count(*) from</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117523#M1187000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This may be beacause of any errors in the condition in the cond_syntax. some thing may be missed in that..can pls specify the code. ie,values of P_TABNAME and cond_syntax.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 09:07:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117523#M1187000</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-02T09:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: select count(*) from</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117524#M1187001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The vales are filled depending on the call of the routine.&lt;/P&gt;&lt;P&gt;In this case P_TABNAME is BSEG and for the testing the values in cond_syntax are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BELNR EQ 0100000000 AND BUKRS EQ 0001 AND BUZEI GE 001 AND GJAHR EQ 1995&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I try with BUKRS EQ 0001 AND GJAHR EQ 1995 I get 0 entries back when I expect 2&lt;/P&gt;&lt;P&gt;If I try with BUKRS EQ 1000 AND GJAHR EQ 1995 I get 12k entries back when I expect 12K - so correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Graham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 09:09:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117524#M1187001</guid>
      <dc:creator>glittle_tjc</dc:creator>
      <dc:date>2009-02-02T09:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: select count(*) from</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117525#M1187002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SELECT statement has to return the dbcount.&lt;/P&gt;&lt;P&gt;You just Make sure that WHERE condition is passed on properly.&lt;/P&gt;&lt;P&gt;You can also check the DB Table for which you want to see the count(SE11) and see if the your condition is working here for at least one value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 09:17:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117525#M1187002</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-02T09:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: select count(*) from</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117526#M1187003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Graham,&lt;/P&gt;&lt;P&gt;In below statement &lt;/P&gt;&lt;P&gt;BUKRS EQ 0001 AND GJAHR EQ 1995 &lt;/P&gt;&lt;P&gt;when you fill condition for BUKRS make sure that it is &lt;STRONG&gt;'0001' and not '1'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manoj Kumar P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 09:18:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117526#M1187003</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-02T09:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: select count(*) from</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117527#M1187004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yogesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, this is what I don't understand.&lt;/P&gt;&lt;P&gt;Using the same code with the same style cond_syntax, one case returns the correct value and the other not.&lt;/P&gt;&lt;P&gt;In SE11 it returns the correct values all the time.&lt;/P&gt;&lt;P&gt;This makes me think I've missed out something somewhere but I have no idea what.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Graham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 09:20:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117527#M1187004</guid>
      <dc:creator>glittle_tjc</dc:creator>
      <dc:date>2009-02-02T09:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: select count(*) from</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117528#M1187005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's probably because BUKRS = 0001 is selecting effectively as BUKRS = 1, so try with BUKRS = '0001'.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 09:21:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117528#M1187005</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-02-02T09:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: select count(*) from</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117529#M1187006</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;Pass the values of BUKRS and BELNR with single( ' ) quotes like '0001'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 09:21:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117529#M1187006</guid>
      <dc:creator>former_member222860</dc:creator>
      <dc:date>2009-02-02T09:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: select count(*) from</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117530#M1187007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manoj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is 0001, the line in the post is a direct cut and paste from debugging.&lt;/P&gt;&lt;P&gt;Maybe I should try it as '0001'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Graham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 09:22:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117530#M1187007</guid>
      <dc:creator>glittle_tjc</dc:creator>
      <dc:date>2009-02-02T09:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: select count(*) from</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117531#M1187008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mahesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try it now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Graham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 09:23:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117531#M1187008</guid>
      <dc:creator>glittle_tjc</dc:creator>
      <dc:date>2009-02-02T09:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: select count(*) from</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117532#M1187009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas, Mahesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Excellent!&lt;/P&gt;&lt;P&gt;I just put in some ' ' in debugging and it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Graham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2009 09:25:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count-from/m-p/5117532#M1187009</guid>
      <dc:creator>glittle_tjc</dc:creator>
      <dc:date>2009-02-02T09:25:51Z</dc:date>
    </item>
  </channel>
</rss>

