Skip to Content
avatar image
Former Member

drop down list valuies are empty

Hi All,

I tried executing a the below code for drop down list in a alv table. but while executing the list is empty. i feel the value in the internal table is not getting set in the attribute VALUESET that i created in the context node. Kindly suggest me a way to resolve this issue.

data: lt_valueset type table of wdr_context_attr_value,

lo_nd_assesstment TYPE REF TO if_wd_context_node,

ls_valueset type wdr_context_attr_value,

lr_node_info type ref to if_wd_context_node_info,

lr_dropdown_key type ref to cl_salv_wd_uie_dropdown_by_idx.

ls_valueset-value = 'first'.

ls_valueset-text = 'first'.

append ls_valueset to lt_valueset.

ls_valueset-value = 'second'.

ls_valueset-text = 'second'.

append ls_valueset to lt_valueset.

lr_node_info = lo_nd_assesstment->get_node_info( ).

lr_node_info->set_attribute_value_set( name = 'VALUESET' value_set = lt_valueset ).

call method l_value->if_salv_wd_column_settings~get_column

exporting

id = 'WEIGHTAGE'

receiving

value = lr_column.

create object lr_dropdown_key

exporting

selected_key_fieldname = 'WEIGHTAGE' .

call method lr_dropdown_key->SET_valueset_FIELDNAME

exporting

value = 'VALUESET'.

call method lr_dropdown_key->SET_type

exporting

value = if_salv_wd_c_uie_drdn_by_index=>type_key_convert_to_value.

call method lr_column->set_cell_editor

exporting

value = lr_dropdown_key.

call method l_value->if_salv_wd_table_settings~set_read_only

exporting

value = abap_false.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 15, 2011 at 03:45 PM

    Hi maha.,

    refer this article [Drop Down in ALV in Web Dynpro ABAP|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0cbdde3-fe58-2c10-fcbc-8db18e693877?quicklink=index&overridelayout=true]

    hope this helps u.,

    Thanks & Regards

    Kiran

    Add comment
    10|10000 characters needed characters exceeded

    • hi,

      What errors you are getting.. there is no wrong in this code..

      try this.. i am using this dropdown in my table and getting values.. change as per yours.

      DATA : node_info TYPE REF TO if_wd_context_node_info,

      value TYPE wdy_key_value,

      set TYPE wdy_key_value_table,

      k2 type string value 'BOX',

      v2 type string value 'BOX',

      k3 type string value 'LOOSE',

      v3 type string value 'LOOSE'.

      value-key = k2.

      value-value = v2.

      APPEND value to set.

      value-key = k3.

      value-value = v3.

      APPEND value to set.

      node_info = wd_context->get_node_info( ).

      node_info = node_info->get_child_node( 'PACK_MAT' ). // your node here

      node_info->set_attribute_value_set( name = 'PACK_MATERIAL'

      value_set = set ). // your column attribute here

      Cheers,

      Kris.