cancel
Showing results for 
Search instead for 
Did you mean: 

retreiving the selected row index value

former_member199125
Active Contributor
0 Kudos

Hi guys,

I have an ALV table, if I click on any particular cell,then it should open a pop window. ( i am able to open pop up ).

My requirement is

how can we retrieve the index of selected cell ?

Regards

Srinivas

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member206441
Contributor
0 Kudos

Hi

Try this Code

Data: context_element type ref to if_Wd_context_element.

context_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).

context_element->get_static_attributes( importing static_attributes = ls_stru ).

Regards

Arun.P

former_member199125
Active Contributor
0 Kudos

hi arun,

I dnt want the cell structure values, I want to know the index value of selected cell.

My requirement: IN alv table , by default it will select first row, if i click on any cell then it wll open open a pop with secondary information related to t that cell value.

But here if i click on any cell , it is showing secondary information of first row value.

If I want to get secondary information of second row value, first i have to select second row, then i have to click on any cell of the second row, so i wll get secondary information for second row,

So my requirement is without selecting second row, if i click on any cell of second row i should be able to retrieve the secondary information of second row value.

So, here how can we get the index value of selected cell ?, if we know the index value, then my problem will solve.

Regards

Srinivas

Regards

Srinivas

former_member450736
Active Participant
0 Kudos

Hi Srinivas,

create 'Event handler' for the event 'ON_CLICK' of alv interface controller in your controller, this event handler has got two parameters

1. r_param type ref to if_salv_wd_table_click

2. wdevent type ref to cl_wd_custom_event

using any of the above parameters you can get index of current row where link is being clicked.

lv_index = r_param->index .

or

we can use wdevent parameter also!!!

hope this is what you are looking for.

former_member199125
Active Contributor
0 Kudos

Yes Kranthi,

I am looking for the same.

I wil check with it and let you know . and

in statemtn r_param-> index index is the system parameter?

How can we know using r_param what are the values we can get?

Regards

Srinivas

Former Member
0 Kudos

HI sanasrinivas,

"When you clicking any cell its showing information of first row" because in your context node 'initialized lead selection' is set so to get details of any row you have to select that one.

Any way you can achieve the same by using the r_param parameter any time. If you using ON_CLICK event handler then get directly the index value like

DATA INDEX_VALUE TYPE I.

INDEX_VALUE = R_PARAM->INDEX.

if you are using ONDATACHECK use like :-

FIELD-SYMBOLS: <WA_ROW> LIKE LINE OF R_PARAM->T_MODIFIED_CELLS.

FIELD-SYMBOLS: <L_VALUE> TYPE ANY.

DATA: INDEX_VALUE TYPE I.

LOOP AT R_PARAM->T_MODIFIED_CELLS ASSIGNING <WA_ROW>.

ASSIGN <WA_ROW>-R_VALUE->* TO <L_VALUE>.

INDEX_VALUE = <WA_ROW>-INDEX.

ENDLOOP.

You will get the index value easily.

Reply in case of any issue.

Regards,

Monishankar C

former_member184578
Active Contributor
0 Kudos

Hi Srinivas,

Check this article., [ALV with POPUP on selection in WDA|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/7020c76f-c40e-2e10-a795-d88e67740ee4?quicklink=index&overridelayout=true]

hope this helps u.,

Thanks & Regards

Kiran