cancel
Showing results for 
Search instead for 
Did you mean: 

Data-dependent Dropdown in an ALV. Webdynpro ABAP

Former Member
0 Kudos

Hi friends,

I am developing an ALV in a Webdynpro and I am having many problems with a dropdown field, I have been looking for a while for a solution both in google and here and I can't find any : (.

The problem is that I have this ALV wich has one date field (08.08.2012 for ex) and this other field (which is the dropdown field) and is dependant on the value of the first one.

DATE_FIELD          DROPDOWN_FIELD

2012                         Values corresponding to the 2012 exercise

2011                         Values corresponding to the 2011 exercise

New               empty           line

New               empty           line

New               empty           line

I have been trying to implement this but it doesn't seems possible, if I have in the dropdownd field the set of values for 2012 I can't change it when I introduce a new line with 2011 as the date.

I have been thinking and maybe I should not be using a dropdown field for this problem, maybe I should try to use a search help for this but I don't know how can I use a search help in this case (I am trying currently, if I suceed I will post it here).

Has anyone had the same problem? Can someone give a hand with this? Any help will be greatly appreciated.

Thanks in advance and kind regards,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If you are using an attribute for DROPDOWN_FIELD and setting values using method Set_Attribute_Value_Set then it will change valueset for all rows.

To have different values in different rows in a drop down in an ALV or a table, you need to use DropDownByIndex Cell editor.

You can also use OVS if you don't want to use DropDownByIndex. In OVS search help, you can write the logic to fetch the desired set of values based on date selected by user i.e. 2012 or 2011 .

Read the DATE_FIELD using CONTEXT_ELEMENT in OVS and accordingly fetch & set the required values for OVS.

Regards,

Rohit

Former Member
0 Kudos

Hi all,

I think I explained the problem simplier than it is, the date field is not a field where we inform the exercise (2012 for example) but a field where we informa a normal date (15.09.2012, 01.04.2012, 23.10.2011).

Anyhow, Rohit's answer can be helpful, I have another urgent task right now but once I have finished it I will try to use a DropDownByIndex.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello everyone,

Well today I finally had the time to try and code this, finally I have used an OVS search help and it works quite well giving the freedom to fill the possible values with any data I want.

If someone finds it difficult to find some help coding OVS search helps in an ALV I can say that it is not different from a normal OVS, you just declare the field in the ALV as OVS and it works fine.

Thank you all for the help,

Best regards.

chengalarayulu
Active Contributor
0 Kudos

Vicent,

Better you can add DATE_FIELD also as DropDown.. then we can catch the column in ON_CLICK of ALV event... then will be able to fill next dropDown based on selected Date..

It may help you..