cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown list box - reg

Former Member
0 Kudos

Hi experts,

Can anyone give me the step by step procedure to create dropdown list box?

I hav to create a dropdown box, it ll display some details in a table while selecting an element from that list.

Regards

Raaam's...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

refer to this link

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos
abhimanyu_lagishetti7
Active Contributor
0 Kudos

you are talking about Combo Box, where you can see all the options available not like dropdown.

you don't have such control in Web Dynpro ABAP, you have to make use of Drop Down by Index or Drop down by Key if you want select a single option, see satandard component WDR_TEST_EVENTS to know how to use these UI elements

OR

you have to use Table control with single column ( selection mode : Multiple )

Abhi

Former Member
0 Kudos

Hi Abhi,

Thanks for ur reply. Me too asking abt dropdown index/ dropdown key. I couldnt get clear idea from WDR_TEST_EVENTS. Thats y i hav posted this thread. If u can, plz give suitable way to proceed...

Former Member
0 Kudos

Take a look at this code... assuming you have got an context node called DD and one attribute caled DDLIST in it.


  DATA:
    lo_nd_dd                   TYPE REF TO if_wd_context_node,
    lo_ndinfo_dd               TYPE REF TO if_wd_context_node_info,
    ls_value_set                        TYPE wdr_context_attr_value,
    int_value_set                       TYPE wdr_context_attr_value_list.

    ls_value_set-value = 'A'.
    ls_value_set-text = 'Text for A'.
    APPEND ls_value_set TO int_value_set.
    CLEAR ls_value_set.

    ls_value_set-value = 'B'.
    ls_value_set-text = 'Text for B'.
    APPEND ls_value_set TO int_value_set.
    CLEAR ls_value_set.


  lo_nd_dd = wd_context->get_child_node( name = wd_this->wdctx_dd ).

  lo_ndinfo_dd = lo_nd_dd->get_node_info( ).

  lo_ndinfo_dd->set_attribute_value_set(
    name = 'DDLIST'
    value_set = int_value_set ).

you can write this code in WDDOINIT of the view in which this dropdownlist element is shown.

Hope this will help you.

-Haresh

abhimanyu_lagishetti7
Active Contributor
0 Kudos

You have 2 controls DropDownByIndex and DropDownByKey

For DropDownByIndex the properties of the UI control which shows the options is TEXTS

You have to create a Context Node of Cardinality 0..n or 1..n and add a context attribute to the newly created Context Node

Now bind the context attribute to the TEXTS property of the UI element

If you run the DropDown will be empty, because there are no elements in the Context Node

To fill the drop down you have to add elements to the Context Node using

node->bind_elements( ). see the method FILLDROPDOWN1 in the methods tab of WDR_TEST_EVENTS

For DropDownByKey the property is SelectedKey, bind it to a Cotnext Attribute of type any data elment whose domain has some Value Range - see the properties of the selectedKey1 context attribute in WDR_TEST_EVENTS

Abhi