Skip to Content
0
Former Member
Apr 29, 2011 at 02:00 PM

Supply method to populate values dynamically in dropdown

42 Views

DATA: lo_nd_ministry TYPE REF TO if_wd_context_node,

lr_node_info TYPE REF TO if_wd_context_node_info.

DATA ls_ministry TYPE wd_this->element_ministry.

DATA lv_ministry LIKE ls_ministry-ministry.

lo_nd_ministry = wd_context->get_child_node( name = 'MINISTRY' ).

lr_node_info = lo_nd_ministry->get_node_info( ).

CALL METHOD lo_nd_ministry->get_attribute

EXPORTING

  • index = USE_LEAD_SELECTION

name = 'MINISTRY'

IMPORTING

value = lv_ministry .

TYPES : BEGIN OF ty_item,

item TYPE comt_product_id,

END OF ty_item.

DATA ls_item TYPE ty_item. "wd_this->Element_item.

DATA lt_item TYPE STANDARD TABLE OF ty_item."wd_this->Element_item.

  • e.g. call a data providing FuBa

if lv_ministry = '1'.

ls_item-item = '100011'. " sample only !

APPEND ls_item TO lt_item.

elseif lv_ministry = '2'.

ls_item-item = '100012'. " sample only !

APPEND ls_item TO lt_item.

endif.

node->bind_table(

EXPORTING

new_items = lt_item

set_initial_elements = abap_true )

.

This is my code in supply function of child node ITEM which is binded to a drop down by index field, Ministry is binded to a drop down by key field, my requirement is to populate drop down by index conditionally when ministry is selected each time. I have coded the above code in supply function. The selective population of drop down ITEM is not happening. Kindly provide inputs.