DATA ********
CLASS alv_event_receiver DEFINITION DEFERRED. "声明类对象 第一步
CLASS alv_event_receiver DEFINITION. "声明类成员可见性 第二步
PUBLIC SECTION.
CLASS-METHODS:
handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column es_row_no.
ENDCLASS. "ALV_EVENT_RECEIVER DEFINITION
CLASS alv_event_receiver IMPLEMENTATION. "实现类方法 第三步
METHOD handle_double_click.
DATA ls_tab TYPE ztmm002.
READ TABLE gt_tab INTO ls_tab INDEX es_row_no-row_id.
IF e_column-fieldname = 'VBELN'. VBELN 是ALV报表对应要双击的字段
SET PARAMETER ID 'VL' FIELD ls_tab-vbeln. VL在vl03的界面填写单号的地方 F1找到的参数ID
CALL TRANSACTION 'VL03' AND SKIP FIRST SCREEN. VL03 是要跳到的事务代码
ENDIF.
ENDMETHOD. "handle_double_click
ENDCLASS. "alv_event_receiver IMPLEMENTATION
START-OF-SELECTION.
SET HANDLER alv_event_receiver=>handle_double_click "注册ALV中引用的事件 第四步 在ALV显示之前写
FOR ALL INSTANCES.
gr_table->display( ). ALV显示