Skip to Content
author's profile photo Former Member
Former Member

alv input feild drop down

hi all,

i want a <b>drop down</b> list in the <b>ALV GRID</b> input field, but i hv no idea for it can anybody gave me some idea or sample program for that,

thanks in advanced

chetan vishnoi

Message was edited by: chetan vishnoi

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 07:07 AM

    Hi Chetan,

    U need to declare the data for drop down.

    for ex.

    data : drop_down_handle type int4.

    then set your dropdown field editable and assign the fieldname

    ex..

    ls_fcat-edit = 'X'.

    ls_fcat-drdn_field = 'DROP_DOWN_HANDLE'.

    ls_fcat-outputlen = 5

    Then define the drop drown pass it to alv

    ex....

    form< name u give>

    data: lt_dropdown type lvc_t_drop,

    ls_dropdown type lvc_s_drop.

    ls_dropdown-handle = '1'.

    ls_dropdown-value = 'car'.

    append ls_dropdown to lt_dropdown.

    ls_dropdown-handle = '2'.

    ls_dropdown-value = 'fan'.

    append ls_dropdown to lt_dropdown.

    ls_dropdown-handle = '2'.

    ls_dropdown-value = 'pan'.

    append ls_dropdown to lt_dropdown.

    ls_dropdown-handle = '2'.

    ls_dropdown-value = 'can'.

    append ls_dropdown to lt_dropdown.

    call method g_grid->set_drop_down_table

    exporting it_drop_down = lt_dropdown.

    endform.

    This is how we write the drop down.....

    regards,

    Deepti.

    plz reward if found helpful..

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 06:40 AM

    Check both the demo programs

    BCALV_EDIT_06

    BCALV_EDIT_07 and change your code as per your requirement.

    Add comment
    10|10000 characters needed characters exceeded

    • Hello,

      Just add this form in your code

      form DROP_DOWN_HANDLE.

      data: lt_dropdown type lvc_t_drop,

      ls_dropdown type lvc_s_drop.

      loop at itab.

      ls_dropdown-handle = sy-tabix.

      ls_dropdown-value = itab-matnr.

      append ls_dropdown to lt_dropdown.

      endloop.

      call method g_grid->set_drop_down_table

      exporting it_drop_down = lt_dropdown.

      endform.

      Regards,

      Naimesh