‎2009 Mar 26 12:25 PM
Hi to All,
This is Satheesh Charles, Newly join to this Forum.
I want to count number of female patient under some condition,
If Month = JAN & patient_gender = F i have to count all the F value.
How to perform this operation ?. pls suggest.
‎2009 Mar 26 12:28 PM
Various way
1)You can use Select Count(*) from tabname into cnt where your where condition
where cnt is of type integer i.e. i.
2)you can use sy-dbcnt after your select statement..
Now its upto you which one you use.
Regards.
Sarbajit.
‎2009 Mar 26 12:27 PM
‎2009 Mar 26 12:39 PM
‎2009 Mar 26 12:28 PM
Various way
1)You can use Select Count(*) from tabname into cnt where your where condition
where cnt is of type integer i.e. i.
2)you can use sy-dbcnt after your select statement..
Now its upto you which one you use.
Regards.
Sarbajit.
‎2009 Mar 26 12:29 PM
HI,
DATA: g_fcount type I.
IF Month = JAN AND patient_gender = 'F'.
g_fcount = g_fcount + 1.
ENDIF.
‎2009 Mar 26 12:36 PM
Thanks for your valuable answer, But i have to perform this operaion in crystal report not in DB
‎2009 Mar 26 12:30 PM
Hello,
You can use the SAP provided library function, COUNT,
refer the URL,
[http://help.sap.com/saphelp_nw04/helpdata/en/48/b4e443c0ca11d2a97100a0c9449261/frameset.htm]
‎2009 Mar 26 12:37 PM
Dear Sateesh
Welcome to the forum.
if u have that values in an internal table u can do as follows
let us assume that the internal table is ITAB
and it has the following fields at minimum
month " field names are self explanatory
gender
declare another internal table as below
data : begin of itab_new occurs 0,
month(3) type c, -
>" same field names as in ITAB
gender(1) type c,
count type i,
end of itab_new.
loop at ITAB.
clear : itab_new.
move-corresponding ITAB to ITAB_NEW. (this will work if the field names are exactly same in both
ITAB_NEW-COUNT = 1. the tables)
collect ITAB_NEW.
endloop.
if u want only 'F' the use WHERE addition in LOOP , like
LOOP AT ITAB_NEW WHERE GENDER = 'F'.
Regards
Prabumanoharan
‎2009 Mar 26 12:42 PM
Thank you prabhu,
How ever i have to perform this operation with CRYSTAL REPORTS formula coloum