on 03-15-2007 10:10 AM
Hi,
I have a value range attached to a field at the domain level which i am using as a drop_down_key in my webdynpro application.
I want to change it at runtime for certain conditions i want to attach more values to the drop down on certain conditions want to remove some values in the drop down even the ones for which the values are specified at domain level.
Please Help.
Divya
Hi divya,
To fix values to the drop down key at runtime in the webdynpro application you can use the following code:
DATA:
lr_node_flightinfo TYPE REF TO if_wd_context_node,
lr_nodeinfo_flightinfo TYPE REF TO if_wd_context_node_info,
l_scarr type scarr,
lt_value_set TYPE TABLE OF wdr_context_attr_value,
lw_value_set like line of lt_value_set.
get nodeinfo of node flightinfo
lr_node_flightinfo = wd_context->get_child_node( name = 'FLIGHTINFO' ).
lr_nodeinfo_flightinfo = lr_node_flightinfo->get_node_info( ).
get value set (VALUE = CARRID , TEXT = CARRNAME)
select carrid carrname from scarr into table lt_value_set.
clear lw_value_set.
lw_value_set-value = 'AI'.
lw_value_set-text = 'Air India'.
append lw_value_set to lt_value_set.
sort the value set by the describing TEXT
SORT lt_value_set BY text.
set value to context attribute
lr_nodeinfo_flightinfo->set_attribute_value_set(
name = 'CARRID' value_set = lt_value_set ).
Here CARRID is a drop down by key field on the screen.
in The context it is an attribute in the node FLIGHTINFO.
Please give Reward Points if this piece of code helps
Regards,
Manish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I tried this on my field thanks.
It works.
Thanks
Divya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.