2008 Jan 07 7:18 AM
Hi all
In my ALV report, in primary list i ll select some records . to count the number of records get selected, i used a loop.
Below is my piece of code.
count = 0.
loop at int where box = 'X'.
count = count + 1.
endloop.
but client says not to use loop.
how can i do that?
Regards
Karthik
Hi all
In my ALV report, in primary list i ll select some records . to count the number of records get selected, i used a loop.
Below is my piece of code.
count = 0.
loop at int where box = 'X'.
count = count + 1.
endloop.
but client says not to use loop.
how can i do that?
Regards
Karthik
2008 Jan 07 7:21 AM
hi,
check the sy-tfill
Data : i type i.
so after using select statement.
i = sy-tfill.
in i total count is stored means total no of rows is stored.
Rewards if it is helpful to u.
Regards,
Arpit
2008 Jan 07 7:26 AM
Hi,
Use this.
DESCRIBE TABLE int LINES count.
Now variable count contains no.of records in ur table.
Rewards points if helpful.
Regards,
Srinivas Ch
2008 Jan 07 7:29 AM
Hi ,
Are you using classes or FM to implement the ALV.
Regards
Arun
2008 Jan 07 7:30 AM
Hi,
read table it_tab with key w_box = 'X'.
if sy-subrc eq 0.
counter = counter + 1.
endif.
PLzz reward points if it helps.
2008 Jan 07 7:33 AM
Hi karthikeyan,
If you use OOPs concepts for ur ALV display, then the you can use the method GET_SELECTED_ROWS_BASE of CL_GUI_ALV_GRIDwhich will give an internal table consisting of all rows selected. You can describe that internal table and get the no.of rows selected.
Hope this will resolve your issue.
Regards,
Kasinath Babu.
2008 Jan 07 7:36 AM
Hi,
Use select statement with where condition( like BOX in internal table would be 'X').
if sy-subrc = 0.
DESCRIBE TABLE itab LINES n.
endif.
then u come to know 'N' no.of records with box is 'X'.
reward pts if it helps......