Application Development 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: 

HOW CAN I HAVE THE NUMBER OF SELECTED ROWS IN ALV GRID?

Former Member
0 Kudos

HI.

HOW CAN I HAVE THE NUMBER OF SELECTED ROWS IN ALV GRID????

GABRY 😃

3 REPLIES 3

Former Member
0 Kudos

You must have declared a filed for check box.


LOOP AT ITAB WHERE CHECK = 'X'.
COUNT = COUNT + 1.
ENDLOOP.

Former Member
0 Kudos

Hi,

You need to introduce a field 'MARK' in the output table, and assign the field in the layout

layout-box_fieldname = 'MARK'.

then in the user_command you need to loop at your output tab where mark = 'X'.

regards,

Advait

former_member194669
Active Contributor
0 Kudos

You need to use


 data : grid1  type ref to cl_gui_alv_grid.
  call method grid1->get_selected_rows
    importing
      et_index_rows = i_sel_alvrows[].