Skip to Content
avatar image
Former Member

DropdownByIndex in WebDynpro for abap

Hi

I am new to Dynpro form ABAP. Anybody tell how to create DropdownByIndex. Please help me.

regards

Arjun

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Sep 10, 2008 at 07:37 AM

    Hi,

    You have UI Elements Drop Down by index and Drop down by Key.You can drag and drop on to view and write the following code to populate values for drop down.

    DATA: lr_node type ref to if_wd_context_node.
    data: lr_info type ref to if_wd_context_node_info.
    data: lt_valueset type WDR_CONTEXT_ATTR_VALUE_LIST.
    data: ls_valueset type line of WDR_CONTEXT_ATTR_VALUE_LIST.
    
    ls_valueset-value = '1'.
    ls_valueset-text = 'first option'.
    append ls_valueset to lt_valueset.
    
    ls_valueset-value = '2'.
    ls_valueset-text = 'second option'.
    append ls_valueset to lt_valueset.
    
    lr_node = wd_context->get_child_node( '<Attribute node which is binded to Dropdown' ).
    lr_info = lr_node->get_node_info( ).
    
    lr_info->SET_ATTRIBUTE_VALUE_SET( name = '<attribute name binded to dropdown>'
    value_set = lt_valueset ).

    also check this example

    WDR_TEST_UI_ELEMENTS

    WDR_TEST_EVENTS.

    Thanks

    Suman

    Edited by: suman kumar chinnam on Sep 10, 2008 9:40 AM

    Add comment
    10|10000 characters needed characters exceeded