2010 May 07 9:28 AM
Hi,
I have displayed ALV using the class CL_GUI_ALV_GRID. I want to trigger a user command when I click on the Box of a record in the ALV displayed. How can I acheive this? I know to capture using a separate button on the application tool bar, but here I want to capture the command once I click on the Box of the ALV.
Thanks,
Sarath.C
Hi,
I have displayed ALV using the class CL_GUI_ALV_GRID. I want to trigger a user command when I click on the Box of a record in the ALV displayed. How can I acheive this? I know to capture using a separate button on the application tool bar, but here I want to capture the command once I click on the Box of the ALV.
Thanks,
Sarath.C
2010 May 07 9:39 AM
Hi Sarath,
You can define that column as hotspot and process event hotspot_click or you just process event double_click.
Regards, Gerd Rother
2010 May 07 12:05 PM
2010 May 11 12:58 PM
The situation is solved as below,
----
CLASS lcl_alv_wrapper DEFINITION INHERITING FROM cl_gui_alv_grid.
PUBLIC SECTION.
METHODS : constructor,
set_delay_time,
click FOR EVENT delayed_changed_sel_callback OF cl_gui_alv_grid.
ENDCLASS. "lcl_alv_wrapper DEFINITION
----
CLASS lcl_alv_wrapper IMPLEMENTATION.
METHOD constructor.
super->constructor( i_parent = cl_gui_container=>default_screen ).
SET HANDLER me->click FOR ALL INSTANCES.
ENDMETHOD. "constructor
METHOD set_delay_time.
me->set_delay_change_selection( 10 ).
ENDMETHOD. "set_delay_time
METHOD click.
MESSAGE 'Hello' TYPE 'I'.
ENDMETHOD. "click
ENDCLASS. "lcl_alv_wrapper IMPLEMENTATION
DATA : grid TYPE REF TO lcl_alv_wrapper,
layout TYPE lvc_s_layo,
table TYPE STANDARD TABLE OF makt.
AT SELECTION-SCREEN OUTPUT.
CREATE OBJECT grid.
SELECT * FROM makt INTO CORRESPONDING FIELDS OF TABLE table UP TO 27 ROWS.
layout-sel_mode = 'D'.
grid->set_table_for_first_display( EXPORTING i_structure_name = 'MAKT'
is_layout = layout
CHANGING it_outtab = table ).
grid->register_delayed_event( i_event_id = cl_gui_alv_grid=>mc_evt_delayed_change_select ).
grid->set_delay_time( ).
Thanks,
Sarath.C
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |