cancel
Showing results for 
Search instead for 
Did you mean: 

DropDown in ALV bound to cell, not to column

Former Member
0 Kudos

Hi Gurus,

do you know a way how to bind (the values of) a dropdown to a particular cell and not to a complete column?

Background:

We have an ALV which provides multiple DropDowns (DD), which should be filled in dependence of each other. For example

Row1-DD1 --> Selected value = 1 --> DD2 offers: 1,2,3

Row2-DD1 --> Selected value = 2 --> DD2 offers: 4,5,6 (hope that makes it clear???)

Any chance to realize this?

Kind regards, Steffen

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

HI Steffen

Supply function can be a solution to think.

Regards

Chaitanya.A

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

U can the following code and add drop down by key in ALV.

data:lv_dropdown TYPE REF TO cl_salv_wd_fe_dropdown_by_key,

lr_dropdown_by_key TYPE REF TO cl_salv_wd_uie_dropdown_by_key.

CREATE OBJECT lr_dropdown_by_key

EXPORTING

selected_key_fieldname = 'APPR_STATUS'.

DATA lref_cell_action TYPE REF TO CL_SALV_WD_CONFIG_TABLE.

CREATE OBJECT lref_cell_action.

CALL METHOD lr_config_table->if_salv_wd_table_settings~set_cell_action_event_enabled

EXPORTING

value = ABAP_TRUE."to make the cell editable.

Regards,

Priya

Former Member
0 Kudos

Hi Steffen,

You will have to use dropdownbyindex for this scenario,

Check this thread []

Regards,

Radhika.

uday_gubbala2
Active Contributor
0 Kudos

Hi Steffen,

This is very much possible by using an DropDownByIndex in your ALV. When using dropdown lists in columns, using the DropDownByIndex view element is inevitable if selection lists with different values are to be displayed for different rows. The DropDownByKey view element cannot be used

here, because the value set is always valid for all elements of a context node. For a table/ALV, this characteristic applies to every row and would therefore result in the same contents being displayed in every row.

You might consider having a look at the standard WDA component DEMO_VARIABLE_DROPDOWN in which each row of the table has different values being displayed in the DropDowns of column URL's. Am just quoting this as an example to see the difference you can achieve using the DropDownByIndex element.

Regards,

Uday

steffen_weber
Employee
Employee
0 Kudos

Hi Uday,

thanks, but the DEMO_VARIABLE_DROPDOWN contains only a standard table and no code dropdowns. We need to realize that in an ALV, any suggestions?

Regards, Steffen

mariano_gallicchio2
Participant
0 Kudos

Hi Steffen,

You should have inside the context node that contains the data for ALV, another context node with cardinality 0..n.

So, each row of the alv, have a component that is a list.

Then you create a Dropdown for that component.

Hope it helps.

Mariano