cancel
Showing results for 
Search instead for 
Did you mean: 

double click on alv grid

Former Member
0 Kudos

how do i handle the event of double click on a psrticular

row of ALV grid

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member

Hello Kaushik,

first you have to register the events you want to handle in your report. In your case it should be 'DOUBLE_CLICK':

SET HANDLER lcl_event_handler=>on_double_click FOR og_alv.

Next you define a local class in your report (or you generate a global class):

CLASS lcl_event_handler DEFINITION.

PUBLIC SECTION.

CLASS-METHODS:

on_double_click FOR EVENT double_click OF cl_gui_alv_grid

IMPORTING E_ROW E_COLUMN ES_ROW_NO

ENDCLASS.

Last you implement your coding: What has to be done, if a user makes a doubleclick:

CLASS lcl_event_handler IMPLEMENTATION.

METHOD on_double_click.

.....

ENDMETHOD.

ENDCLASS.

In the coding you can use the export-parameters of the event (= import-parameters of your method on_double_click) to locate the field, the action was taken.

Regards,

Martin

ssimsekler
Active Contributor
0 Kudos

Hi

As an addition to Martin's post, assuming again you use the OO version of ALV Grid here is the parameter definitions for the event:

The parameter “e_row” is obsolete. Other two parameters are “es_row_no” which is of type “LVC_S_ROID” and passes information about the row index at “es_row_no-row_id”, and “e_column” of type “LVC_S_COL” which returns the column fieldname at “e_column-fieldname”. Utilizing these parameters you know where the user clicked and trigger your action.

*--Serdar

Former Member
0 Kudos

Hi,

Check the link:

http://www.sapbrain.com

Regards,

Bhaskar

Former Member
0 Kudos

hi

refer the program bcalv_grid_03 .

Regards

sarath

0 Kudos

Hi everybody,

I have two alv grid tables on my screen.

How can I determine on which one the double click was performed?

Thanks in advance!

BR

Tobias

EDIT:

I found it...

When you create the event_receiver object you can specify the name of you alv.

CREATE OBJECT event_receiver.

SET HANDLER event_receiver->handle_double_click FOR name_of_alv.

Message was edited by:

Tobias Oelschlaeger

Former Member
0 Kudos

hi kaushik,

As addition to martin and serdar.

you need to define event definition and implementation of the event.

*declare these things in your programme

  • local class to handle semantic checks

CLASS lcl_event_receiver DEFINITION DEFERRED.

DATA: g_event_receiver TYPE REF TO lcl_event_receiver.

*event definition

CLASS lcl_event_receiver DEFINITION.

public section.

METHODS: handle_double_click

FOR EVENT double_click OF cl_gui_alv_grid IMPORTING e_row e_column.

ENDCLASS.

*event implementation.

CLASS lcl_event_receiver IMPLEMENTATION.

METHOD handle_double_click.

      • Give condition what you want to do.

      • example

read table <internal table> index e_row-index into <TABLE NAME>.

call screen 100. "design this screen what fields you want to show from the alv grid.

Endmethod.

ENDCLASS.

regards,

Venu.

juancarlos_tena
Explorer
0 Kudos

Hello,

I have did all this. And Only this work me, when in the fieldcatalog have no edit field. In other case, work me.

Anybody knows how can have the edit field and in the double click return me the row (so return 1) ?

Thanks in advance.

Paloma

athavanraja
Active Contributor
0 Kudos

If you are using CL_GUI_ALV_GRID class you could use double_click event

Regards

Raja

Former Member
0 Kudos

Hi Kaushik,

I am not very clear on your requirement, but if you want to identify that double click has happened and on which row and column you can implement the DOUBLE_CLICK event.

Pavan