Skip to Content
Mar 26, 2010 at 12:32 PM

ALV functions to insert records (&LOCAL&COPY_ROW and &LOCAL&INSERT_ROW)



I think that these functions behave strange.

I have made local class method for EVENT data_changed OF cl_gui_alv_grid where I try to use the table er_data_changed->mt_inserted_rows to update my internal table.

But if I for example have 4 rows in the alv, and I mark line 3 and press the insert row button, then then a blank line will be inserted at row 3 and push the old rows 3 and 4 to row 4 and 5.

So far so good. But the row_id in the mt_inserted_rows will be set to 5 indication that the new row is row number 5 and this is useless - or did I miss something.

I want to insert a blank record in my internal table at the same row as it was inserted in the alv (that is in row 3), but how can I know that it was in fact row 3 and not row 5 that was newly inserted.

I have same problem whit the Duplicate row function (&LOCAL&COPY_ROW).

best regards

Thomas Madsen Nielsen