본문 바로가기
ABAP

ALV Drop down list

by clode 2023. 2. 21.
728x90
반응형

fieldcatalog 속성에 추가해준다.

ls_fdcat-drdn_hndl = '1'. 
ls_fdcat-checktable = '!'. 

ALV 드롭다운 만들어주기

 FORM alv_cl_dropdown_list .

  DATA : lt_dropdown TYPE lvc_t_dral,
         ls_dropdown TYPE lvc_s_dral.

*    CLEAR ls_dropdown.
*    ls_dropdown-handle = '1'. "지금은 드롭다운이 하나라 핸들이 1
*    ls_dropdown-int_value = '직영점'. "선택되는 값
*    ls_dropdown-value = '직영점'. "보여지는 값?
*    APPEND ls_dropdown to lt_dropdown.
*
*    CLEAR ls_dropdown.
*    ls_dropdown-handle = '1'.
*    ls_dropdown-int_value = '프랜차이즈'.
*    ls_dropdown-value = '프랜차이즈'.
*    APPEND ls_dropdown to lt_dropdown.

  SELECT ddtext
    FROM dd07t
    INTO TABLE @DATA(lt_ddtext)
   WHERE domname = 'ZDVCT'.

  LOOP AT lt_ddtext INTO DATA(ls_ddtext).
    CLEAR ls_dropdown.
    ls_dropdown-handle    = '1'.
    ls_dropdown-int_value = ls_ddtext-ddtext.
    ls_dropdown-value     = ls_ddtext-ddtext.
    APPEND ls_dropdown TO lt_dropdown.
  ENDLOOP.

  "alv에서 드롭다운이 보여지도록 설정하는 함수
  CALL METHOD gv_alv_grid1->set_drop_down_table
    EXPORTING
      it_drop_down_alias = lt_dropdown.

ENDFORM.
728x90
반응형

'ABAP' 카테고리의 다른 글

금액 텍스트 변환 Function  (0) 2023.02.21
알고 있으면 유용한 Syntax  (0) 2023.02.21
Working day function  (0) 2023.02.21
ALV Top-of-Page  (0) 2023.02.21
ALV 특정 Cell EDIT  (0) 2023.02.21

댓글