SCREEN 100
인사마스터 ver 1의 PBO와 동일하므로 참고하기.
2020/09/12 - [ABAP 실습/인사 마스터만들기] - 인사마스터 ALV 프로젝트 ver 1.1
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
MODULE SET_ALV_0100.
PROCESS AFTER INPUT.
MODULE EXIT_100 AT EXIT-COMMAND.
MODULE USER_COMMAND_0100.
MODULE status_0100 OUTPUT.
SET PF-STATUS '0100'.
SET TITLEBAR '0100'.
ENDMODULE.
MODULE set_alv_0100 OUTPUT.
PERFORM SETTING_ALV_100.
ENDMODULE.
FORM setting_alv_100 .
IF G_GRID IS INITIAL.
"인스턴스 생성"
PERFORM CREATE_OBJECT.
"출력필드 생성"
PERFORM SET_FIELDCATALOG.
"레이아웃 세팅"
PERFORM SET_LAYOUT.
"이벤트 등록"
PERFORM SET_EVENT.
"ALV 호출"
PERFORM DISPLAY_ALV.
ELSE.
"G_GRID가 초기값이 아닐 경우에는 REFRESH를 해주어라"
PERFORM REFRESH_DATA.
FORM set_fieldcatalog.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'STAT'. "필드명 선언"
GS_FIELDCAT-COLTEXT = '상태'. "필드명을 표현하는 텍스트"
GS_FIELDCAT-KEY = 'X'. "KEY로 설정"
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'EMPNO'.
GS_FIELDCAT-COLTEXT = '사원번호'.
GS_FIELDCAT-KEY = 'X'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'NAME'.
GS_FIELDCAT-COLTEXT = '이름'.
GS_FIELDCAT-EDIT = 'X'. "수정가능 유무설정"
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'DEPT'.
GS_FIELDCAT-COLTEXT = '부서'.
GS_FIELDCAT-REF_TABLE = 'ZT00_0010'.
GS_FIELDCAT-EDIT = 'X'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'DEPT_T'.
GS_FIELDCAT-COLTEXT = '부서내역'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'ENTDT'.
GS_FIELDCAT-COLTEXT = '입사일'.
GS_FIELDCAT-EDIT = 'X'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'GRADE'.
GS_FIELDCAT-COLTEXT = '직급'.
GS_FIELDCAT-REF_TABLE = 'ZT00_0010'.
GS_FIELDCAT-EDIT = 'X'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'GRADE_T'.
GS_FIELDCAT-COLTEXT = '직급내역'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'RETDT'.
GS_FIELDCAT-COLTEXT = '퇴사일'.
GS_FIELDCAT-EDIT = 'X'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'STATUS'.
GS_FIELDCAT-COLTEXT = '재직구분'.
GS_FIELDCAT-REF_TABLE = 'ZT00_0010'.
GS_FIELDCAT-EDIT = 'X'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'STATUS_T'.
GS_FIELDCAT-COLTEXT = '재직구분 내역'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'PHONE'.
GS_FIELDCAT-COLTEXT = '전화번호'.
GS_FIELDCAT-EDIT = 'X'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'ADDR_H'.
GS_FIELDCAT-COLTEXT = '자택주소'.
GS_FIELDCAT-EDIT = 'X'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'ADDR_W'.
GS_FIELDCAT-COLTEXT = '근무지주소'.
GS_FIELDCAT-EDIT = 'X'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'SALARY'.
GS_FIELDCAT-COLTEXT = '기본급'.
GS_FIELDCAT-CFIELDNAME = 'WAERS'. "돈은 반드시 참조 필드가 필요"
GS_FIELDCAT-EDIT = 'X'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'WAERS'.
GS_FIELDCAT-COLTEXT = '통화'.
APPEND GS_FIELDCAT TO GT_FIELDCAT.
CLEAR GS_FIELDCAT.
GS_FIELDCAT-FIELDNAME = 'RESULT'.
GS_FIELDCAT-COLTEXT = '처리결과'.
APPEND GS_FIELDCAT
FORM create_object .
CREATE OBJECT CON1_REF
EXPORTING
CONTAINER_NAME = 'CON1'.
CREATE OBJECT G_GRID
EXPORTING
I_PARENT = CON1_REF.
ENDFORM.
FORM set_layout .
CLEAR GS_LAYOUT.
GS_LAYOUT-ZEBRA = 'X'.
GS_LAYOUT-CWIDTH_OPT = 'A'.
GS_LAYOUT-SEL_MODE = 'D'.
GS_LAYOUT-NO_ROWINS = 'X'.
ENDFORM.
FORM display_alv .
CALL METHOD G_GRID->set_table_for_first_display
EXPORTING
is_layout = gs_layout
CHANGING
it_outtab = GT_DISP
it_fieldcatalog = gt_fieldcat.
ENDFORM.
FORM SET_EVENT .
CREATE OBJECT GO_EVENT_RECEIVER.
SET HANDLER GO_EVENT_RECEIVER->HANDLE_DOUBLE_CLICK
FOR G_GRID.
SET HANDLER GO_EVENT_RECEIVER->HANDLE_DATA_CHANGED
FOR G_GRID.
SET HANDLER GO_EVENT_RECEIVER->HANDLE_TOOLBAR
FOR G_GRID.
SET HANDLER GO_EVENT_RECEIVER->HANDLE_USER_COMMAND
FOR G_GRID.
ENDFORM.
FORM refresh_data .
CALL METHOD G_GRID->REFRESH_TABLE_DISPLAY.
ENDFORM.
반응형
'SAP ABAP 개발 및 설명 > 인사 마스터만들기' 카테고리의 다른 글
인사마스터 ALV 프로젝트 ver 2 (트랜잭션 설정) (0) | 2020.10.10 |
---|---|
인사마스터 ALV 프로젝트 ver 2 (PAI) (0) | 2020.10.10 |
인사마스터 ALV 프로젝트 ver 2 (CLASS문) (0) | 2020.10.02 |
인사마스터 ALV 프로젝트 ver 2 (TOP문 , 메인프로그램) (0) | 2020.10.02 |
인사마스터 ALV 프로젝트 ver 1.3 (0) | 2020.09.17 |