cancel
Showing results for 
Search instead for 
Did you mean: 

Drop Down by key in webdynpro application

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

If we add some values to the filed which bounded to Dropdownbykey, how about the validation? As these new values are not in the domain values, will this throw error ?

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I tried this on my field thanks.

It works.

Thanks

Divya