cancel
Showing results for 
Search instead for 
Did you mean: 

restrict the number of visible values in drop down by key?

Former Member
0 Kudos

Hello,

Is it possible to restrict the max. number of entries displayed in a drop down by key element? By default i get 10 entries which i would like to limit to 5. Thanks.

Regards,

Vasu

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

if node name is init then write the folowing code in wddoinit().

How many values u wnat u can insert into table.

DATA: lo_nd_init TYPE REF TO if_wd_context_node,

lo_nd_init_info TYPE REF TO if_wd_context_node_info,

lt_dbtag_set TYPE wdy_key_value_table,

dbtag_key_item TYPE wdy_key_value,

lv_header_visible TYPE wdy_boolean,

lo_element TYPE REF TO if_wd_context_element,

lo_nd_init = wd_context->get_child_node( name = wd_this->wdctx_init ).

*To insert values of dropdown list into internal table

dbtag_key_item-key = 'STD'

dbtag_key_item-value = 'STANDARD'

INSERT dbtag_key_item INTO TABLE lt_dbtag_set.

dbtag_key_item-key = 'CMPD'

dbtag_key_item-value = 'COMPOUND'

INSERT dbtag_key_item INTO TABLE lt_dbtag_set.

*To get node info and set the drop down list values

lo_nd_init_info = lo_nd_init->get_node_info( ).

lo_nd_init_info->set_attribute_value_set( name = 'ACC_TYPE_DESCR' value_set = lt_dbtag_set ).

Former Member
0 Kudos

Hi Vasu,

I don't think that it is possible. Those are related to WD ABAP setting. We can't manupulate those settings.

Best Regards,

Vijay

Former Member
0 Kudos

Also, if the values are not required any more..you can go and delete the fixed values ranges in the domain....or you can manually fill the values set that you want to display.

Former Member
0 Kudos

Hi,

If you have a set of default values (which come from the domain), you can restrict them to the specific values which you need to display. In the INIT method of the view in which this UI element is present, you will have to write code to delete the entries which you do not wish to show in the drop down by key element.

Have a look at this code snippet:

data: node_info type ref to if_wd_context_node_info,

elem_attr type wdr_context_attribute_info.

node_info = wd_context->get_node_info( ).

node_info = node_info->get_child_node( 'CHILD_NODE' ).

data: lt_valueset type wdr_context_attr_value_list,

l_value type wdr_context_attr_value.

call method node_info->get_attribute

exporting

name = 'ATTR1'

receiving

attribute_info = elem_attr.

lt_valueset = elem_attr-value_set.

delete lt_valueset where value = 'VALUE1'.

node_info->set_attribute_value_set(

name = 'ATTR1'

value_set = lt_valueset ).

Hope this helps.

Regards,

Wenonah

olivier_muff
Explorer
0 Kudos

Dear Wenonah,

I like your idea. The question I have is. If your domain is used in a drop-down list and you exclude a value. What happens to the display of records that use that excluded value? I assume they will then have an emply field in the dorp-down. Is that right?

Olivier

Former Member
0 Kudos

Hi,

I dont think this is possible.

Regards,

Nithya