我想覆盖 ALV 网格中的某些功能。但我无法通过回调用户命令来做到这一点。这仅适用于非标准功能。任何的想法?我应该使用事件退出吗?我用它尝试了一些东西,但也做不到:P
FORM event_exits.
CLEAR wa_eventexit.
wa_eventexit-ucomm = '&OUP'.
wa_eventexit-before = 'X'.
APPEND wa_eventexit TO it_eventexit.
CLEAR wa_eventexit.
wa_eventexit-ucomm = '&ODN'.
wa_eventexit-before = 'X'.
APPEND wa_eventexit TO it_eventexit.
ENDFORM. "event_exits
FORM user_command Using r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&OUP'.
IF ck_del = 'X'.
SORT gt_salord BY audat vbeln lfimg ASCENDING.
ELSE.
SORT gt_salord BY audat vbeln kwmeng ASCENDING.
ENDIF.
WHEN '&ODN'.
IF ck_del = 'X'.
SORT gt_salord BY audat vbeln lfimg DESCENDING.
ELSE.
SORT gt_salord BY audat vbeln kwmeng DESCENDING.
ENDIF.
WHEN 'D01'.
BREAK-POINT.
ENDCASE.
CLEAR sy-ucomm.
ENDFORM. "user_command
D01 功能仅用于测试,因此当我访问它时,我可以看到它进入了 user_command。但是当我访问函数 &OUP 时,它不再在 CASE 中输入(我通过调试对其进行测试)