Application Development and Automation 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: 
Read only

alv list using classes

Former Member
0 Likes
365

hi,

I am using CL_SALV_TABLE to alv list

cl_salv_table=>factory(

EXPORTING

list_display = if_salv_c_bool_sap=>true

IMPORTING

r_salv_table = gr_table

CHANGING

t_table = it_final2 ).

gr_functions = gr_table->get_functions( ).

gr_functions->set_all( abap_true ).

gr_table->display( ).

please tell me how to get double click functionality in this list

regards,

kushagra

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
341

Hi,

Here you are a class :

----


  • CLASS lcl_handle_events DEFINITION

----


*

----


CLASS lcl_handle_events DEFINITION.

PUBLIC SECTION.

METHODS:

on_double_click FOR EVENT double_click OF cl_salv_events_table

IMPORTING row column.

ENDCLASS. "lcl_handle_events DEFINITION

DATA: event_handler TYPE REF TO lcl_handle_events.

----


  • class lcl_handle_events implementation

----


*

----


CLASS lcl_handle_events IMPLEMENTATION.

METHOD on_double_click.

DATA: message TYPE string.

DATA: row_c(4) TYPE c.

row_c = row.

CONCATENATE 'Row' row_c 'Column' column INTO message SEPARATED BY space.

MESSAGE i001(00) WITH 'You double-clicked on ' message.

ENDMETHOD. "on_double_click

ENDCLASS. "lcl_handle_events IMPLEMENTATION

and how you can call this method:

CREATE OBJECT event_handler.

SET HANDLER event_handler->on_double_click FOR o_events.

Regards,

Reward point if it's useful.

1 REPLY 1
Read only

Former Member
0 Likes
342

Hi,

Here you are a class :

----


  • CLASS lcl_handle_events DEFINITION

----


*

----


CLASS lcl_handle_events DEFINITION.

PUBLIC SECTION.

METHODS:

on_double_click FOR EVENT double_click OF cl_salv_events_table

IMPORTING row column.

ENDCLASS. "lcl_handle_events DEFINITION

DATA: event_handler TYPE REF TO lcl_handle_events.

----


  • class lcl_handle_events implementation

----


*

----


CLASS lcl_handle_events IMPLEMENTATION.

METHOD on_double_click.

DATA: message TYPE string.

DATA: row_c(4) TYPE c.

row_c = row.

CONCATENATE 'Row' row_c 'Column' column INTO message SEPARATED BY space.

MESSAGE i001(00) WITH 'You double-clicked on ' message.

ENDMETHOD. "on_double_click

ENDCLASS. "lcl_handle_events IMPLEMENTATION

and how you can call this method:

CREATE OBJECT event_handler.

SET HANDLER event_handler->on_double_click FOR o_events.

Regards,

Reward point if it's useful.