abap oo alv编辑时立刻调用事件如何实现
functionalv时,设置编辑事件data_changed时可以通过设置lvc_s_glay来启动编辑立即调用data_changed事件,但是ooalv该如何实现该...
function alv时,设置编辑事件data_changed时可以通过设置lvc_s_glay来启动编辑立即调用data_changed事件,但是oo alv该如何实现该功能
展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
1个回答
展开全部
*----------------------------------------------------------------------*
* CLASS LCL_EVENT_HANDLER DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS LCL_EVENT_HANDLER DEFINITION.
PUBLIC SECTION.
METHODS:
**--基于单元格的效验
HANDLE_DATA_CHANGED FOR EVENT DATA_CHANGED OF CL_GUI_ALV_GRID
IMPORTING ER_DATA_CHANGED E_ONF4 E_ONF4_BEFORE E_ONF4_AFTER E_UCOMM,
*--热点点击控制
HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,
* 双击
HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW E_COLUMN ES_ROW_NO.
ENDCLASS. "LCL_EVENT_HANDLER DEFINITION
*----------------------------------------------------------------------*
* CLASS LCL_EVENT_HANDLER IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
METHOD HANDLE_DATA_CHANGED. "单元格事件触发相关
PERFORM HANDLE_DATA_CHANGED USING ER_DATA_CHANGED.
ENDMETHOD. "HANDLE_DATA_CHANGED
*-- Handle hotspot click
METHOD HANDLE_HOTSPOT_CLICK. "单击事件
PERFORM HANDLE_HOTSPOT_CLICK USING E_ROW_ID E_COLUMN_ID ES_ROW_NO.
ENDMETHOD. "handle_hotspot_click
* 双击
METHOD HANDLE_DOUBLE_CLICK.
PERFORM HANDLE_DOUBLE_CLICK USING E_ROW E_COLUMN ES_ROW_NO.
ENDMETHOD. "handle_double_click
ENDCLASS. "LCL_EVENT_HANDLER IMPLEMENTATION
*&---------------------------------------------------------------------*
*& Form HANDLE_DATA_CHANGED
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->IR_DATA_CHANGED text
*----------------------------------------------------------------------*
FORM HANDLE_DATA_CHANGED USING IR_DATA_CHANGED
TYPE REF TO CL_ALV_CHANGED_DATA_PROTOCOL.
DATA LS_MOD_CELL TYPE LVC_S_MODI.
DATA LT_MOD_CELL TYPE LVC_T_MODI.
DATA LV_VALUE TYPE LVC_VALUE.
SORT IR_DATA_CHANGED->MT_MOD_CELLS BY ROW_ID.
ENDFORM. "HANDLE_DATA_CHANGED
* CLASS LCL_EVENT_HANDLER DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS LCL_EVENT_HANDLER DEFINITION.
PUBLIC SECTION.
METHODS:
**--基于单元格的效验
HANDLE_DATA_CHANGED FOR EVENT DATA_CHANGED OF CL_GUI_ALV_GRID
IMPORTING ER_DATA_CHANGED E_ONF4 E_ONF4_BEFORE E_ONF4_AFTER E_UCOMM,
*--热点点击控制
HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO,
* 双击
HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW E_COLUMN ES_ROW_NO.
ENDCLASS. "LCL_EVENT_HANDLER DEFINITION
*----------------------------------------------------------------------*
* CLASS LCL_EVENT_HANDLER IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
METHOD HANDLE_DATA_CHANGED. "单元格事件触发相关
PERFORM HANDLE_DATA_CHANGED USING ER_DATA_CHANGED.
ENDMETHOD. "HANDLE_DATA_CHANGED
*-- Handle hotspot click
METHOD HANDLE_HOTSPOT_CLICK. "单击事件
PERFORM HANDLE_HOTSPOT_CLICK USING E_ROW_ID E_COLUMN_ID ES_ROW_NO.
ENDMETHOD. "handle_hotspot_click
* 双击
METHOD HANDLE_DOUBLE_CLICK.
PERFORM HANDLE_DOUBLE_CLICK USING E_ROW E_COLUMN ES_ROW_NO.
ENDMETHOD. "handle_double_click
ENDCLASS. "LCL_EVENT_HANDLER IMPLEMENTATION
*&---------------------------------------------------------------------*
*& Form HANDLE_DATA_CHANGED
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->IR_DATA_CHANGED text
*----------------------------------------------------------------------*
FORM HANDLE_DATA_CHANGED USING IR_DATA_CHANGED
TYPE REF TO CL_ALV_CHANGED_DATA_PROTOCOL.
DATA LS_MOD_CELL TYPE LVC_S_MODI.
DATA LT_MOD_CELL TYPE LVC_T_MODI.
DATA LV_VALUE TYPE LVC_VALUE.
SORT IR_DATA_CHANGED->MT_MOD_CELLS BY ROW_ID.
ENDFORM. "HANDLE_DATA_CHANGED
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询