cancel
Showing results for 
Search instead for 
Did you mean: 

Setting DropDown List Value in screen

Former Member
0 Kudos
860

Hi

I have a UI table element. In this am having some 10 records.

I have a EDIT button and a drop down box in the same view.

When i select a record and click on my EDIT button, the currency corresponding to the selected record in table will be displayed in the dropdown box. For example INR in this case.

I am able to achieve this by using set attribute code as given below.

  • set currency attribute

lo_el_n_curr->set_attribute(

name = `CURR`

value = wa_itable-ztable_curr ).

Now the problem is, if i click on the drop down box, the first value in the drop down box is overwrititien by INR.

What happens is that whatever value is in the currency field for a record, it is replacing the first default value (ADP) in the drop down box. i.e. ADP is disappearing in the drop down list.

NOTE: INR is repeating twice in the dropdown list.

How to solve this problem? Or is there any other way to set the currency attribute in drop down without affecting the default first value.

View Entire Topic
Former Member
0 Kudos

Hi,

For Ex:

When you get the currency of that record into lv_curr,

Try to read the table to which the Dropdown is bound against lv_curr and get that index, lv_index.

For this dropdown now set to this index.

Regards,

Lekha.

Former Member
0 Kudos

hi,

i got your point. thanks a lot.

can u please suggest me how to get the index after i get the currency value lv_curr. I am able to get the currency value into the variable lv_curr. But how to get the index of that currency in drop down list.

Please explain in detail.

Thanks.

Former Member
0 Kudos

Hi,

For Ex:

When you get the currency of that record into lv_curr,

Try to read the table to which the Dropdown is bound against lv_curr and get that index, lv_index.

For this dropdown now set to this index.

For the dropdowns, you might have bound some table with currency list right.Ex lt_table.

read table lt_table into ls_table with key code = lv_curr.
if sy-subrc eq 0.
lv_index = sy-tabix.
endif.

Now using the set_lead_selection_index of if_wd_context_node.

Regards,

Lekha.

Edited by: Lekha on Aug 27, 2009 4:45 PM