cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown in dependence of another dropdown in table ui

0 Kudos

I developed a solution with two dropdwon ui (both byKey) If i select a value in dropdown1 values in dropdown2 apear. Tha functions. My problem is if i select a value of dropdown1 in row 2, the value of dropdown2 in row1 will also change like in row2.

What is the solution to change only the values of the selected row and not of the whole column?

Thanks

Edited by: Lars Schmittgen on Jul 4, 2011 1:28 PM

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Lars,

Check your subnodes and NOT SINGLETON.

I done this type of requirement using Drop down by index.

Write select query to get second dropdown values based on first.

Cheers,

Kris.

former_member199125
Active Contributor
0 Kudos

In this case,you should generate the second dropdown values based on first dropdown.

I mean in onSelect action of dropdown1 you should generate the values for dropdown2.

Now try and let me know

Srinivas

..

saravanan_narayanan
Active Contributor
0 Kudos

Might be you can try DropDownByIndex(DDBI)for the second dropdown. the node for the DDBI should be sub node of the Table's context node and this sub node values should be populated based on the value in dropDown1.

BR, Saravanan

0 Kudos

Hi,

i tried this in dependend action of dropdown1. dropdown2 is by index.

  • get single attribute

lo_el_parameter->get_attribute(

exporting

name = `FELD1`

importing

value = lv_feld1 ).

if lv_feld1 = 'Erlöse'.

move: 'BWA_ERL_1' to ls_value_set-value,

'BWA Erlöse 1' to ls_value_set-text.

append ls_value_set to lt_value_set.

move: 'BWA_ERL_2' to ls_value_set-value,

'BWA Erlöse 2' to ls_value_set-text.

append ls_value_set to lt_value_set.

endif.

if lv_feld1 = 'Kosten'.

move: 'BWA_Kst_1' to ls_value_set-value,

'BWA Kosten 1' to ls_value_set-text.

append ls_value_set to lt_value_set.

move: 'BWA_Kst_1' to ls_value_set-value,

'BWA Kosten 1' to ls_value_set-text.

append ls_value_set to lt_value_set.

endif.

lo_nd_info_spalte2_tab = lo_nd_info_parameter->get_child_node( name = 'SPALTE2_TAB' ).

lo_nd_info_spalte2_tab->set_attribute_value_set( name = 'FELD2'

value_set = lt_value_set ).

Spalte2_tab is subnode of lo_nd_info_parameter. Feld2 is the attribut. But in the moment i see no values.

saravanan_narayanan
Active Contributor
0 Kudos

For DropDownByIndex you need to create a context node of cardinality 0..n and populate the dropdown values.Pls have a look at the following example which explains about how to add DDBI in Table UI Element

[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c03227f9-e48f-2c10-4bad-8ebdec704f3d?quicklink=index&overridelayout=true]

Value set is applicable only for DDBK and not for DDBI. Hope this helps.

BR, Saravanan

saravanan_narayanan
Active Contributor
0 Kudos

might be you can dry DropDownByIndex(DDBI) for the second dropdown. the node for this DDBI should be sub node of the Table's context node and values for this sub node should be populated based on the value in DropDown1

BR, Regards,

Saravanan