Drunken Lion

[ALV] LIST BOX 만들기 본문

SAP/ALV

[ALV] LIST BOX 만들기

DrkLion 2009. 6. 3. 12:56
* FIELDCAT 설정
        gs_fcat_lvc-edit = 'X'.
        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.


'SAP > ALV' 카테고리의 다른 글

ALV LAYOUT 관련  (0) 2012.02.15
[ALV] Function ALV 에서 데이터 변환 강제 인식  (0) 2009.10.12
[ALV] DATA_CHANGED EVENT  (1) 2009.06.02
[ALV]툴바에 버튼 추가하기  (0) 2009.06.02
CLASS ALV에서 간단한 FIELD CATALOG 생성  (0) 2009.03.23