用事件类实现双击事件,实例化后使用set handler注册到ALV对象。红字部分为事件方法的具体实现。
代码如下
CLASS lcl_tree_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS handle_node_double_click
FOR EVENT node_double_click OF cl_gui_alv_tree
IMPORTING node_key sender.
ENDCLASS.
CLASS lcl_tree_event_receiver IMPLEMENTATION.
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = ‘BACK‘.
CALL METHOD cl_gui_cfw=>flush.
ENDMETHOD.
ENDCLASS.
时间: 2024-10-04 13:17:46