Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Reg alv

Former Member
0 Likes
807

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

6 REPLIES 6
Read only

arpit_shah
Contributor
0 Likes
782

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

Read only

Former Member
0 Likes
782

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

Read only

Former Member
0 Likes
782

Hi ,

Are you using classes or FM to implement the ALV.

Regards

Arun

Read only

Former Member
0 Likes
782

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.

Read only

Former Member
0 Likes
782

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.

Read only

Former Member
0 Likes
782

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......