<?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: Count With Condition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387541#M1238537</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Various way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)You can use Select Count(*) from tabname into cnt  where &lt;STRONG&gt;your where condition&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    where cnt is of type integer i.e. i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)you can use sy-dbcnt after your select statement..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now its upto you which one you use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sarbajit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Mar 2009 12:28:22 GMT</pubDate>
    <dc:creator>sarbajitm</dc:creator>
    <dc:date>2009-03-26T12:28:22Z</dc:date>
    <item>
      <title>Count With Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387539#M1238535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi to All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is Satheesh Charles, Newly join to this Forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to count number of female patient under some condition,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If  Month = JAN &amp;amp; patient_gender = F i have to count all the F value.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to perform this operation ?. pls suggest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 12:25:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387539#M1238535</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T12:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Count With Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387540#M1238536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use a &lt;STRONG&gt;COUNTER&lt;/STRONG&gt; with the IF statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 12:27:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387540#M1238536</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T12:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Count With Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387541#M1238537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Various way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)You can use Select Count(*) from tabname into cnt  where &lt;STRONG&gt;your where condition&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    where cnt is of type integer i.e. i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)you can use sy-dbcnt after your select statement..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now its upto you which one you use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sarbajit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 12:28:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387541#M1238537</guid>
      <dc:creator>sarbajitm</dc:creator>
      <dc:date>2009-03-26T12:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Count With Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387542#M1238538</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;PRE&gt;&lt;CODE&gt;DATA: g_fcount type I.

IF Month = JAN AND patient_gender = 'F'.
 g_fcount = g_fcount + 1.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 12:29:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387542#M1238538</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T12:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Count With Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387543#M1238539</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 can use the SAP provided library function, COUNT, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refer the URL,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[http://help.sap.com/saphelp_nw04/helpdata/en/48/b4e443c0ca11d2a97100a0c9449261/frameset.htm]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 12:30:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387543#M1238539</guid>
      <dc:creator>siddhesh_pathak4</dc:creator>
      <dc:date>2009-03-26T12:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: Count With Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387544#M1238540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your valuable answer, But i have to perform this operaion in &lt;STRONG&gt;crystal report&lt;/STRONG&gt; not in DB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 12:36:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387544#M1238540</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T12:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Count With Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387545#M1238541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Sateesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Welcome to the forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u have that values in an internal table u can do as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let us assume that the internal table is ITAB&lt;/P&gt;&lt;P&gt;and it has the following fields at minimum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          month                              " field names are self explanatory&lt;/P&gt;&lt;P&gt;          gender&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare another internal table as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of itab_new occurs 0,&lt;/P&gt;&lt;P&gt;          month(3) type c,                    -&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt;&amp;gt;" same field names as in ITAB&lt;/P&gt;&lt;P&gt;          gender(1) type c,&lt;/P&gt;&lt;P&gt;          count type i,&lt;/P&gt;&lt;P&gt;         end of itab_new.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at ITAB.&lt;/P&gt;&lt;P&gt; clear : itab_new.  &lt;/P&gt;&lt;P&gt; move-corresponding ITAB to ITAB_NEW.       (this will work if the field names are exactly same in both &lt;/P&gt;&lt;P&gt; ITAB_NEW-COUNT = 1.                                   the tables)&lt;/P&gt;&lt;P&gt;collect ITAB_NEW.  &lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u want only 'F' the use WHERE addition in LOOP , like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB_NEW WHERE GENDER = 'F'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prabumanoharan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 12:37:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387545#M1238541</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T12:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Count With Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387546#M1238542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you mean by using &lt;STRONG&gt;count&lt;/STRONG&gt; option&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 12:39:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387546#M1238542</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T12:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Count With Condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387547#M1238543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you prabhu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How ever i have to perform this operation with &lt;STRONG&gt;CRYSTAL REPORTS&lt;/STRONG&gt; formula coloum&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 12:42:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/count-with-condition/m-p/5387547#M1238543</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T12:42:41Z</dc:date>
    </item>
  </channel>
</rss>

