cancel
Showing results for 
Search instead for 
Did you mean: 

Drop down by index

Former Member
0 Kudos

hi,

I am facing one problem with one field having property of drop down by index.

In my application i have two view when i select field value data from the first view and set the value to drop down field by using :

lo_nd_veh->set_attribute( EXPORTING name = `ZDESC` value = im_detail-tail ).

but i am getting multiple value ofsame data

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

Hello,

a dropdown by index works by displaying the lead selection of the bound node.

Updating an attribute of an element of this node will just update the lead selection - not change the selection to the value you want.

you could search through the bound node for the element which had the correct value and mark it as lead selection - but... I would suggest that you might be better using a dropdown by key and populating into the attribute info the dropdown list - then setting the attribute value will have the result you are after.

- Chris

Answers (1)

Answers (1)

Former Member
0 Kudos

Initially check that do you get multiple entries in im_detail? If yes, check the data selection steps once again.

If not, then check the Node cardinality is 0..N, for by you are binding the data source of the Dropdown. Also bind all the elements of modified dropdown table as below:

node->bind_table(

new_items = im_detail

set_initial_elements = abap_true ).

Edited by: SANKET SETHI on May 12, 2010 12:55 PM

Former Member
0 Kudos

Hi sanket,

My data is correct .

i am getting problem to set the value from first to second view .i am geeting the value of field on first view, then i am set the attribute value on second view.

Former Member
0 Kudos

Hi,

Try to set the Dropdown table as below:

  • data declaration

DATA im_detail TYPE wd_this->elements_node_dropdown.

DATA ls_item LIKE LINE OF im_detail.

APPEND ls_item TO im_detail.

node->bind_table(

new_items = im_detail

set_initial_elements = abap_true ).

Please revert us back if it will not works for you.

Former Member
0 Kudos

nope it will not work.

ok can you tell me how to set the value of drop down by index . value coming from different view.

i am using set attribute because of setting of attibute drop down display two value of same value which is cmg from first view.

Former Member
0 Kudos

Pass your value to a global attribute(in Comp controller) and get this global attribute where ever you want. Hope it will make your work easy.

Former Member
0 Kudos

Hi Shilpi,

Please as per approach suggested by Chris.

Use set_lead_selection_index method of if_wd_context_node to set the index of Drop down by index to a particular value.

If it would have been a Drop down by key then you could have used Set_attribute and have done the same.