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: 

Events in ALV

Former Member
0 Kudos
183

I show an ALV, and i want to call a program when somebody click a line of ALV, how can i know what line have clicked the user?

Thanks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos
62

Hi,

In the PAI of the screen

DATA: i_fieldrows TYPE lvc_t_row,

MODULE user_command_9001 INPUT.

CALL METHOD o_alvgrid->get_selected_rows

IMPORTING

et_index_rows = i_fieldrows.

LOOP AT i_fieldrows INTO w_fieldrows.

READ TABLE i_output INTO w_output INDEX w_fieldrows-index.

ENDLOOP.

CASE sy-ucomm.

WHEN 'XX'.

.

.

.

ENDCASE.

If u want to select multiple lines in the grid then in the layout w_layout-sel_mode = 'A'.

Hope this helps.

Thanks & Regards,

Judith.

1 REPLY 1

Former Member
0 Kudos
63

Hi,

In the PAI of the screen

DATA: i_fieldrows TYPE lvc_t_row,

MODULE user_command_9001 INPUT.

CALL METHOD o_alvgrid->get_selected_rows

IMPORTING

et_index_rows = i_fieldrows.

LOOP AT i_fieldrows INTO w_fieldrows.

READ TABLE i_output INTO w_output INDEX w_fieldrows-index.

ENDLOOP.

CASE sy-ucomm.

WHEN 'XX'.

.

.

.

ENDCASE.

If u want to select multiple lines in the grid then in the layout w_layout-sel_mode = 'A'.

Hope this helps.

Thanks & Regards,

Judith.