ABAP面向对象ALV 如何触发toolbar事件
答案:1 悬赏:20 手机版
解决时间 2021-03-28 09:44
- 提问者网友:夢醒日落
- 2021-03-27 15:13
ABAP面向对象ALV 如何触发toolbar事件
最佳答案
- 五星知识达人网友:千夜
- 2021-03-27 15:56
你没有使用OK_CODE事件
CLASS LCL_EVENT_RECEIVER DEFINITION.
PUBLIC SECTION.
"双击事件
METHODS:
HANDLE_DOUBLE_CLICK
FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW E_COLUMN.
"工具栏增加按钮
METHODS:
HANDLE_TOOLBAR
FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
IMPORTING E_OBJECT E_INTERACTIVE,
"工具栏增加按钮点击事件
HANDLE_USER_COMMAND
FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
IMPORTING E_UCOMM.
ENDCLASS. "lcl_event_receiver DEFINITION
METHOD HANDLE_USER_COMMAND."控制部分
DATA: L_VALID2 TYPE C .
CLEAR L_VALID2 .
CALL METHOD GIT_ALV_CONTROL2->CHECK_CHANGED_DATA
IMPORTING
E_VALID = L_VALID2.
CASE E_UCOMM.
WHEN 'OUT'.”你自定的
ENDCASE .
ENDMETHOD.追问还是不行,我追加了user_command部分.
现在的问题是,我在
METHOD handle_toolbar.
实现部分设了断点进行调试,程序根本就进去不了创建toolbar部分的流程追答哦 还有这段代码忘了给你说了
CREATE OBJECT GIT_RECEIVER.
SET HANDLER GIT_RECEIVER->HANDLE_DOUBLE_CLICK FOR GIT_ALV_CONTROL1.
SET HANDLER GIT_RECEIVER->HANDLE_USER_COMMAND FOR GIT_ALV_CONTROL1.
SET HANDLER GIT_RECEIVER->HANDLE_TOOLBAR FOR GIT_ALV_CONTROL1.
CALL METHOD GIT_ALV_CONTROL1->SET_TOOLBAR_INTERACTIVE.
CALL METHOD GIT_ALV_CONTROL1->SET_USER_COMMAND
EXPORTING
I_UCOMM = OK_CODE.
解决了就好
CLASS LCL_EVENT_RECEIVER DEFINITION.
PUBLIC SECTION.
"双击事件
METHODS:
HANDLE_DOUBLE_CLICK
FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW E_COLUMN.
"工具栏增加按钮
METHODS:
HANDLE_TOOLBAR
FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
IMPORTING E_OBJECT E_INTERACTIVE,
"工具栏增加按钮点击事件
HANDLE_USER_COMMAND
FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
IMPORTING E_UCOMM.
ENDCLASS. "lcl_event_receiver DEFINITION
METHOD HANDLE_USER_COMMAND."控制部分
DATA: L_VALID2 TYPE C .
CLEAR L_VALID2 .
CALL METHOD GIT_ALV_CONTROL2->CHECK_CHANGED_DATA
IMPORTING
E_VALID = L_VALID2.
CASE E_UCOMM.
WHEN 'OUT'.”你自定的
ENDCASE .
ENDMETHOD.追问还是不行,我追加了user_command部分.
现在的问题是,我在
METHOD handle_toolbar.
实现部分设了断点进行调试,程序根本就进去不了创建toolbar部分的流程追答哦 还有这段代码忘了给你说了
CREATE OBJECT GIT_RECEIVER.
SET HANDLER GIT_RECEIVER->HANDLE_DOUBLE_CLICK FOR GIT_ALV_CONTROL1.
SET HANDLER GIT_RECEIVER->HANDLE_USER_COMMAND FOR GIT_ALV_CONTROL1.
SET HANDLER GIT_RECEIVER->HANDLE_TOOLBAR FOR GIT_ALV_CONTROL1.
CALL METHOD GIT_ALV_CONTROL1->SET_TOOLBAR_INTERACTIVE.
CALL METHOD GIT_ALV_CONTROL1->SET_USER_COMMAND
EXPORTING
I_UCOMM = OK_CODE.
解决了就好
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯