Skip to Content
avatar image
Former Member

How to get selected-value of dropdown-field in alv ?

Hello experts,

I have a alv-table with dropdown-field.

When I open the dropdown I am able to select another value.

Now I use method ON_CLICK with ON_CELL_ACTION, and when

I change value in my alv, system jumps into this mehtod.

But how do I get now the selected dropdown value in this method ?

I use following code in comp-wdini in order to declare the dropdown:

  • Dropdownfield

*----


DATA: lr_dp TYPE REF TO cl_salv_wd_uie_dropdown_by_key.

DATA: lr_node TYPE REF TO if_wd_context_node_info.

DATA: lt_valueset TYPE wdr_context_attr_value_list.

DATA: ls_valueset TYPE wdr_context_attr_value.

DATA : lr_nodeinfo TYPE REF TO if_wd_context_node_info.

DATA wa TYPE cdbc_tj30t.

DATA: lr_drdn_by_index TYPE REF TO cl_salv_wd_uie_dropdown_by_idx.

SELECT * FROM cdbc_tj30t INTO wa WHERE stsma = 'CRMOPPOR' AND

spras = 'DE'.

ls_valueset-value = wa-estat. " actual values

ls_valueset-text = wa-txt30. " text displaying on the dropdown

APPEND ls_valueset TO lt_valueset.

ENDSELECT.

LOOP AT lt_columns INTO ls_column.

CASE ls_column-id.

WHEN 'CONCATSTATUSER'.

CREATE OBJECT lr_drdn_by_index

EXPORTING

selected_key_fieldname = ls_column-id.

lr_drdn_by_index->set_valueset_fieldname( 'VALUESET' ).

lr_drdn_by_index->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).

ls_column-r_column->set_cell_editor( lr_drdn_by_index ).

ENDCASE.

ENDLOOP.

In view-ini I fill the table which is bound to my alv-table:

***************************************************************

LOOP AT lt_list_opportunities INTO lstru_list_opportunities

WHERE status = ls_opportunity_status-estat AND

valid_to <= ls_input-bdate AND valid_from >= ls_input-vdate.

ls_opportunities-valueset = lt_valueset.

MOVE-CORRESPONDING lstru_list_opportunities TO ls_opportunities.

APPEND ls_opportunities TO ltt_list_opportunities.

ENDLOOP.

lo_nd_opportunities = wd_context->get_child_node( name =

wd_this->wdctx_opportunities ).

lo_nd_opportunities->bind_table( new_items = ltt_list_opportunities ).

HOW can I now get the slected dropdown values in ON_CLICK with ON_CELL_ACTION method ?

Thanks for answers !!

Gerd

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Nov 03, 2008 at 02:57 PM

    On which event, do you want to get the drop down values. On click of drop down values or on some other event like button. Becuase if u just want to get on some other event like button, then u have to read it from the context. Pls explain.

    Thanks

    Add comment
    10|10000 characters needed characters exceeded