on 04-15-2011 2:35 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.