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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

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 a 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 a 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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.