SAP/ALV
[ALV] LIST BOX 만들기
DrkLion
2009. 6. 3. 12:56
* FIELDCAT 설정
* DROP DOWN BOX 설정
gs_fcat_lvc-edit = 'X'.
gs_fcat_lvc-drdn_hndl = '1'.
gs_fcat_lvc-drdn_hndl = '1'.
* DROP DOWN BOX 설정
*?.Define a dropdown table and pass it to ALV.
* One listbox is referenced by a handle, e.g., '1'.
* For each entry that shall appear in this listbox
* you have to append a line to the dropdown table
* with handle '1'.
* This handle can be assigned to several columns
* of the output table using the field catalog.
DATA: lt_dropdown TYPE lvc_t_drop,
ls_dropdown TYPE lvc_s_drop.
FIELD-SYMBOLS: <lfs_grid> TYPE REF TO cl_gui_alv_grid.
ASSIGN (p_grid) TO <lfs_grid>.
CHECK sy-subrc = 0.
* First listbox (handle '1').
* 수지구분
LOOP AT gt_cash.
ls_dropdown-handle = '1'.
ls_dropdown-value = gt_cash-ddtext.
APPEND ls_dropdown TO lt_dropdown.
ENDLOOP.
* 자금구분
LOOP AT gt_area.
ls_dropdown-handle = '2'.
ls_dropdown-value = gt_area-ddtext.
APPEND ls_dropdown TO lt_dropdown.
ENDLOOP.
CALL METHOD <lfs_grid>->set_drop_down_table
EXPORTING
it_drop_down = lt_dropdown.
* One listbox is referenced by a handle, e.g., '1'.
* For each entry that shall appear in this listbox
* you have to append a line to the dropdown table
* with handle '1'.
* This handle can be assigned to several columns
* of the output table using the field catalog.
DATA: lt_dropdown TYPE lvc_t_drop,
ls_dropdown TYPE lvc_s_drop.
FIELD-SYMBOLS: <lfs_grid> TYPE REF TO cl_gui_alv_grid.
ASSIGN (p_grid) TO <lfs_grid>.
CHECK sy-subrc = 0.
* First listbox (handle '1').
* 수지구분
LOOP AT gt_cash.
ls_dropdown-handle = '1'.
ls_dropdown-value = gt_cash-ddtext.
APPEND ls_dropdown TO lt_dropdown.
ENDLOOP.
* 자금구분
LOOP AT gt_area.
ls_dropdown-handle = '2'.
ls_dropdown-value = gt_area-ddtext.
APPEND ls_dropdown TO lt_dropdown.
ENDLOOP.
CALL METHOD <lfs_grid>->set_drop_down_table
EXPORTING
it_drop_down = lt_dropdown.