Double click event in ALV
I have an ALV report that uses the function module REUSE_ALV_GRID_DISPAY
to display the screen. I was wondering if there is a way to implementthe
double click event when using this FM. What I want the user to be abl to
do is to double click on a line in the ALV and have another ALV grid
display with a more detailed list. I know that the double click eventcan
be implemented using the object oriented approach using a container bu I
would like to avoid redoing the report to use the object oriented apprach.
Any help would be greatly appreciated.
vasavi vanguru replied
Yes there is a way.
You have to call your function like this:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
I_CALLBACK_PROGRAM = z_variant-report
(or your program name, not sy-repid because this will
change during the use of ALV Grid)
I_CALLBACK_USER_COMMAND = 'USER_COMMAND2'
(or some other name)
then you define your form:
form user_command2 using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
when '&IC1'. (doubleclick)
if rs_selfield-tabindex > 0 and
rs_selfield-sumindex le 0.
read table itab into wa index
then your form for the second grid:
(here you can make your selections for the second grid
based on the row you selected into workarea wa from the
first grid, and then call REUSE_ALV_GRID_DISPLAY again,
with another field catalog, internal table etc...)