ALV GIRD를 만드는 방법 중 CLASS를 이용할 때...
첫번째 방식입니다. [Class 이용시]
CLASS 선언 부분
****************************************************************
* LOCAL CLASSES: Definition
****************************************************************
CLASS LCL_EVENT_RECEIVER DEFINITION.
PUBLIC SECTION.
METHODS : HANDLE_AFTER_USER_COMMAND
FOR EVENT AFTER_USER_COMMAND OF CL_GUI_ALV_GRID.
ENDCLASS. "(LCL_EVENT_RECEIVER DEFINITION)
************************************************************************
* LOCAL CLASSES: Implementation *
************************************************************************
CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
METHOD HANDLE_AFTER_USER_COMMAND.
PERFORM AFTER_USER_COMMAND.
ENDMETHOD.
ENDCLASS. "LCL_EVENT_RECEIVER IMPLEMENTATION
DATA: G_EVENT_RECE TYPE REF TO LCL_EVENT_RECEIVER.
* EVENT 선언한 것을 객체로 만든다.
* EVENT 제어
CREATE OBJECT G_EVENT_RECE.
* 이벤트제어 세팅
SET HANDLER G_EVENT_RECE->HANDLE_AFTER_USER_COMMAND FOR G_ALV_GRID. " G_ALV_GRID는 ALV GIRD 객체 이름
* CLASS 선언 부분에서 METHOD 안에 PERFORM문 호출 Subrotin 입니다.
*&---------------------------------------------------------------------*
*& Form AFTER_USER_COMMAND
*&---------------------------------------------------------------------*
FORM AFTER_USER_COMMAND."USING P_UCOMM.
DATA: L_TOTALINE TYPE SY-TABIX,
L_FIDX TYPE LVC_T_FIDX.
CALL METHOD G_ALV_GRID->GET_FILTERED_ENTRIES
IMPORTING
ET_FILTERED_ENTRIES = L_FIDX.
DESCRIBE TABLE GT_LIST LINES G_TOTALINE.
DESCRIBE TABLE L_FIDX LINES L_TOTALINE.
G_TOTALINE = G_TOTALINE - L_TOTALINE.
SET TITLEBAR '0100' WITH G_TOTALINE.
ENDFORM. " AFTER_USER_COMMAND
두번째 방법입니다.[Function 이용시]
이부분은 제가 작성 해보고 다시 올릴께요~
소스 모두 올리셨네요 ^^ 감사합니다.
덕분에 좋은 공부 하나 했습니다.