就是AFTER_USER_COMMAND这个事件,开始以为是USER_COMMAND,试了半天也没反应。后来看了以前
FM ALV同样问题的解决办法,受了点启发,估计是AFTER_USER_COMMAND这个事件,一试果然是。
CLASS LCL_EVENT DEFINITION.
PUBLIC SECTION.
METHODS:
HANDLE_AFTER_USER_COMMAND FOR EVENT AFTER_USER_COMMAND OF CL_GUI_ALV_GRID
IMPORTING E_UCOMM.
ENDCLASS. "LCL_EVENT DEFINITION
CLASS LCL_EVENT IMPLEMENTATION.
METHOD HANDLE_AFTER_USER_COMMAND.
CASE E_UCOMM.
WHEN '&SORT_ASC' OR '&SORT_DSC'.
LOOP AT IT_OUTPUT ASSIGNING .
-INDEX = SY-TABIX.
ENDLOOP.
ENDCASE.
ENDMETHOD.
ENDCLASS. "LCL_EVENT IMPLEMENTATION
阅读(964) | 评论(1) | 转发(0) |