- Create Date : 2010-08-15
- Change Date : 2010-08-15
잡담 -ㅂ-;
Field Level에서의 Dropdown list
* Fieldcat 선언부
* 여러개로 할경우 hndl 값에 1,2,3 이런식의 순서를 준다.
ls_fieldcat-fieldname = 'CARRID'.
ls_fieldcat-drdn_hndl = '1'.
ls_fieldcat-drdn_alias = 'X'.
APPEND ls_fieldcat TO gt_fieldcat.
* 리스트 데이터 선언
DATA: lt_dropdown TYPE lvc_t_dral,
ls_dropdown TYPE lvc_s_dral.
* 리스트 데이터 생성
ls_dropdown-handle = '1'.
ls_dropdown-int_value = 'AA'.
ls_dropdown-value = 'AA : American Airlines'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-int_value = 'AZ'.
ls_dropdown-value = 'AZ : Alitalia'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-int_value = 'UA'.
ls_dropdown-value = 'UA : United Airlines'.
APPEND ls_dropdown TO lt_dropdown.
* ALV 필드에 적용
CALL METHOD GRID1->set_drop_down_table
EXPORTING
it_drop_down_alias = lt_dropdown.
* alias가 작동되기 위해서는 edit method 를 실행
CALL METHOD grid1->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
CALL METHOD grid1->set_table_for_first_display
* 여러개로 할경우 hndl 값에 1,2,3 이런식의 순서를 준다.
ls_fieldcat-fieldname = 'CARRID'.
ls_fieldcat-drdn_hndl = '1'.
ls_fieldcat-drdn_alias = 'X'.
APPEND ls_fieldcat TO gt_fieldcat.
* 리스트 데이터 선언
DATA: lt_dropdown TYPE lvc_t_dral,
ls_dropdown TYPE lvc_s_dral.
* 리스트 데이터 생성
ls_dropdown-handle = '1'.
ls_dropdown-int_value = 'AA'.
ls_dropdown-value = 'AA : American Airlines'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-int_value = 'AZ'.
ls_dropdown-value = 'AZ : Alitalia'.
APPEND ls_dropdown TO lt_dropdown.
ls_dropdown-handle = '1'.
ls_dropdown-int_value = 'UA'.
ls_dropdown-value = 'UA : United Airlines'.
APPEND ls_dropdown TO lt_dropdown.
* ALV 필드에 적용
CALL METHOD GRID1->set_drop_down_table
EXPORTING
it_drop_down_alias = lt_dropdown.
* alias가 작동되기 위해서는 edit method 를 실행
CALL METHOD grid1->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
CALL METHOD grid1->set_table_for_first_display
* 참고
* checktable = '!' 구문은 check table을 체크하지 않는다.
ls_fieldcat-checktable = '!'.
ls_fieldcat-edit = 'X'.
ls_fieldcat-checktable = '!'.
ls_fieldcat-edit = 'X'.
'ABAP 물타기 > ALV' 카테고리의 다른 글
ALV : METHOD-01 (0) | 2010.09.13 |
---|---|
ALV : fieldcatalog attribute (0) | 2010.08.29 |
ALV : Grid 요소 (0) | 2010.08.15 |
ALV : Layout Other Method (0) | 2010.08.15 |
ALV : Select Layout (at selection-screen 이벤트에 Possible Entry) (0) | 2010.07.04 |