cancel
Showing results for 
Search instead for 
Did you mean: 

How to get selected index of Dropdown by Index in a ALV table

Former Member
0 Kudos

Hello All,

Can any body help me how to Read selected index of a Dropdown By Index in ALV table

I have a ALV table in that 1 column is a Dropdown By Index to show different dropdown values in each row of ALV table. to achieve this I created separate attribute in same context node as VALUESET of type WDR_CONTEXT_ATTR_VALUE_LIST. As part of my requirement I have same Value and Text values for VALUESET

    ls_value_custom-text   = 'TEST'.

    ls_value_custom-value = 'TEST'.

Values are populated and I am getting different values for dropdown on each row of ALV table

My requirement is to Get the Selected index of the dropdown( Ex: From ALV 3rd row I open the dropdown and sleeted 5th value)

I am using event ON_CELL_ACTION to capture change.

r_param->value->* is returning Value of the Dropdown, my issue is I need to get the index of the selected Value

My  r_param->index is returning 3 (3rd row of ALV where I opened the Dropdown)

Thanks,

Venkat.

Accepted Solutions (0)

Answers (2)

Answers (2)

amy_king
Active Contributor
0 Kudos

Hi Venkat,

I see this is a duplicate post of your other discussion,

You may want to close this discussion since the other one has several replies, and add this latest information to your other discussion.

Cheers,

Amy

amy_king
Active Contributor
0 Kudos

Hi Venkat,

The source of the DropDownByIndex  is a table of name/values pairs, so once you have the selected value from r_param->value->*, you can read that table to determine the index.

READ TABLE dropdown_options ASSIGNING <fs> WITH KEY value = the_value.

System variable sy-tabix will indicate the table index where the_value was found.

Cheers,

Amy

Former Member
0 Kudos

Hello Amy,

Thank you for the response...

I couldn't able to Read on value set table because in my dropdown I have duplicate values

CI

CI

HGP

CI

CI

MAJOR

From the dropdown if I select 4th CI value I need to update 2 fields

1st field as CI and 2nd Field as 4

Thanks,

Venkat.