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: 

CL_GUI_ALV_GRID's event CLICK_ROW_COL

Former Member
0 Kudos
4,938

Hello,

in order to allow the user a single click on any cell within the alv grid I would like

use CL_GUI_ALV_GRID's event CLICK_ROW_COL .

It is protected so I can't use that. What I can do in this case ?

Thx in advance for your help.

Spielwiese

1 ACCEPTED SOLUTION

Former Member
772

Hi,

You can provide the Hotspot Option. By passing X to the field hotspot in Fieldcatalog. This will allow the user for single click.

3 REPLIES 3

Former Member
773

Hi,

You can provide the Hotspot Option. By passing X to the field hotspot in Fieldcatalog. This will allow the user for single click.

0 Kudos
772

ok and then how can I ask fo the event ?

Currently I am using double_click event.

Bye

Sw

0 Kudos
772

Look at this code:


CLASS lcl_gui_alv_event_receiver DEFINITION.
  PUBLIC SECTION.
    METHODS:
"        Hotspot click control
          handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid   
                               IMPORTING e_row_id e_column_id es_row_no.    "this will be passed each time your click on the cell
ENDCLASS. 

CLASS lcl_gui_alv_event_receiver IMPLEMENTATION.

  METHOD handle_hotspot_click .
    DATA: l_mess TYPE string,
          l_row(2) TYPE c.

    WRITE es_row_no-row_id TO l_row.
    CONCATENATE 'Hotspot click at: ' e_column_id-fieldname 'in'
                                     l_row 'row.'
                                     INTO l_mess SEPARATED BY space.
    MESSAGE l_mess TYPE 'I'.    "here for example an info message will pop up with cell address
  ENDMETHOD .                    "handle_hotspot_click
ENDCLASS.

DATA: "alv event receiver class
      g_alv_event_ref TYPE REF TO lcl_gui_alv_event_receiver.

CREATE OBJECT g_alv_event_ref.

"set handler for your alv
SET HANDLER g_alv_event_ref->handle_hotspot_click FOR g_alv_grid_ref. "here g_alv_grid_ref must hold your alv grid reference

Regards

Marcin