ABAP 물타기/ALV
ALV : Layout
물타기
2010. 6. 17. 16:18
- Create Date : 2010-06-17
- Change Date : 2010-06-17
잡담 -ㅂ-;
Layout으로 ALV layout을 변경한다. (당연한 소릴하구 있다...)
프로그램 실행시 Layout 을 선택할 수 있다. (일반 현업에겐 과분한 기능인듯 ㅎㅎ)
Create Layout
뭐... 간단하다.
1. Definition
data : con1 type ref to cl_gui_custom_container,
grid1 type ref to cl_gui_alv_grid,
gt_fieldcat type lvc_t_fcat,
gs_layout type lvc_s_layo.
grid1 type ref to cl_gui_alv_grid,
gt_fieldcat type lvc_t_fcat,
gs_layout type lvc_s_layo.
2. Setting
FORM SET_LAYOUT .
gs_layout-cwidth_opt = 'X'. "auto column width
gs_layout-grid_title = 'ALV Edit Test'.
gs_layout-sel_mode = 'D'.
gs_layout-zebra = 'X'.
* gs_layout-edit = 'X'. "edit all alv
ENDFORM.
그리고...
CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = gs_layout
... 이하 생략
gs_layout-cwidth_opt = 'X'. "auto column width
gs_layout-grid_title = 'ALV Edit Test'.
gs_layout-sel_mode = 'D'.
gs_layout-zebra = 'X'.
* gs_layout-edit = 'X'. "edit all alv
ENDFORM.
그리고...
CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = gs_layout
... 이하 생략
Result
Title, 선택기능(Row) 그리고 줄무늬를 넣었다. (줄무늬 아닌것 같아도 자세히 봐보면 zebra~)