Skip to Content
avatar image
Former Member

Drop Down List values within ALV

Hello,

I have an ALV table and want one of the editable cells to be a drop down. I will provide the values. I was able to get everything to work except getting those values in that drop down cell within the ALV.

Looking for the code that will do that.

Thanks,

Irene

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Sep 10, 2008 at 10:51 AM

    if you are using CL_SALV_WD_UIE_A_DRDN_BY_KEY as dropdown

    use SET_SELECTED_KEY_FIELDNAME method to set the selected key property and fill the values using

    data:

    lr_node type ref to If_Wd_Context_Node.

    data : lr_nodeinfo type ref to if_wd_context_node_info,

    lt_valueset type wdr_context_attr_value_list,

    ls_valueset type wdr_context_attr_value,

    WA TYPE SPFLI.

    lr_node = wd_context->get_child_node( 'node name' ).

    lr_nodeinfo = lr_node->get_node_info( ).

    • USE UR TABLE AND FILL ACCORDINGLY

    SELECT * FROM SPFLI INTO WA.

    ls_valueset-value = 'key1'. " actual values

    ls_valueset-text = WA-CARRID. " text displaying on the dropdown

    append ls_valueset to lt_valueset.

    ENDSELECT.

    lr_nodeinfo->set_attribute_value_set(

    exporting

    name = '<attribute name>'

    value_set = lt_valueset

    ).

    Abhi

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 10, 2008 at 06:29 PM

    Hi Abhi, thanks.

    I did try that code and several others and it is still not working. I'm not sure what else is missing.

    The attribute name mapped to the cell in the alv is type string.

    I've tried to put the code in several places, like event handler methods for on_data_check, on_cell_action, init, and still does not work. I have other codes in there and they all work.

    I have a non-alv dropdown and that works. I just can't get the values in that dropdown within the alv.

    I searched for an sap sample that works and could not find any. Those that works are non-alv dropdowns. The closest I could find is salv_wd_test_table_events but even that does not have values in it. I haven't debug that one to figure out if it's because of lack of data or code is just not there.

    I see a lot of postings saying they had the same issues and they've resolved it. But have not found any postings that says this is the solution.

    Any other ideas are appreciated.

    Thanks,

    Irene

    Add comment
    10|10000 characters needed characters exceeded