Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Jul 09, 2007 at 05:13 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 07, 2007 at 05:34 AM

    Hi,

    I dont think this is possible.

    Regards,

    Nithya

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 09, 2007 at 04:01 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • avatar image
    Former Member
    Jul 11, 2007 at 02:19 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 10, 2008 at 03:46 AM

    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 ).

    Add comment
    10|10000 characters needed characters exceeded