cancel
Showing results for 
Search instead for 
Did you mean: 

Get Current row in Editable ALV

former_member450736
Active Participant
0 Kudos

Hi,

I have editable alv, when i press "insert row" or "Append row" i need to get current inserted/appended row element reference or index.

How can i get this??

Please suggest.

Accepted Solutions (1)

Accepted Solutions (1)

alison_lloyd
Active Participant
0 Kudos

have you tried using get_selected_elements method from your table context node?

former_member450736
Active Participant
0 Kudos

i tried it, it is not working, because when we insert/append row it does not actually create row which selected automatically.

alison_lloyd
Active Participant
0 Kudos

I take it the index isn't selected row + 1 or total number of rows + 1?

former_member450736
Active Participant
0 Kudos

there is no point of selection in this case, that is the problem..

Former Member
0 Kudos

I am not clear on what you are trying to do.

Do you want to know the index of the newly inserted or appended row? Or do you want to know the index of the currently selected row BEFORE the insert/append?

It sounds like you might be looking for: lv_index = lo_node->get_lead_selection_index( )

Former Member
0 Kudos

Chek this wiki, this might help you.

[http://wiki.sdn.sap.com/wiki/display/Snippets/Web%20Dynpro%20ABAP%20-%20ALV%20Controlling%20Standard%20Buttons|http://wiki.sdn.sap.com/wiki/display/Snippets/Web%20Dynpro%20ABAP%20-%20ALV%20Controlling%20Standard%20Buttons]

gill367
Active Contributor
0 Kudos

Hi

You can use on_data_check method and there in use the parameter r_param.

to get the inserted rows.

and inserted row will have a field called index which you can use to get the index of inserted row.

it is explained in the link provided by basakaran.

thanks

sarbjeet singh

former_member450736
Active Participant
0 Kudos

thanks bhaskaran,

the link provided is acutally solved my problem.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi kranthi ,

While inserting row you must be selecting a row, you can get the index of the selected row by this following code

  • get Index of selected table item

CALL METHOD NODE_NAME->GET_LEAD_SELECTION_INDEX

RECEIVING INDEX = Lv_Indx.

( DATA: Lv_Indx Type i )

or while you are appending a row you can use Describe int_table LINES lv_line and use the value of 'lv_line' as the index.

Regards

former_member450736
Active Participant
0 Kudos

Hi Anik,

its not necessary that while inserting row i should select the row, that is the reason i did not use get selected element or get lead selection method