cancel
Showing results for 
Search instead for 
Did you mean: 

drop down list valuies are empty

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184578
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi thanks for u r reply. i tried executing the same code and got the error. can u help me out y the value is not displayed in the drop list

Former Member
0 Kudos

Hi Vadiv,

You are giving static values... use dropdownbykey..

Here your code i modified..

DATA : lr_node_info TYPE REF TO if_wd_context_node_info,

ls_valueset TYPE wdy_key_value,

lt_valueset TYPE wdy_key_value_table.

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 = wd_context->get_node_info( ).

lr_node_info = node_info->get_child_node( 'SEGMENT1' ). // Your node name here.

lr_node_info->set_attribute_value_set( name = 'SEGMENT' value_set = lt_valueset ). // Segment is attribute name which you bind

cheers,

Kris.

Former Member
0 Kudos

Hi Kris thanks for u r reply i will try the code you have told and get back in case of queries.

Former Member
0 Kudos

i kris tried executing u r code it returns lot of errors with the method i have used for drop down in the code below

Former Member
0 Kudos

hi kris thanks a lot for u r effort my problem got resolved i tried executing another code.

Former Member
0 Kudos

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.