03-26-2010 12:32 PM
Hi
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©_ROW).
best regards
Thomas Madsen Nielsen
03-29-2010 5:17 PM
The data changed object has a table where ALV-Rows and table-rows are matched:
CL_ALV_CHANGED_DATA_PROTOCOL->MT_ROID_FRONT
Watch in Debugger at event "Data_Changed".
This might answer your confusions...
03-29-2010 5:17 PM
The data changed object has a table where ALV-Rows and table-rows are matched:
CL_ALV_CHANGED_DATA_PROTOCOL->MT_ROID_FRONT
Watch in Debugger at event "Data_Changed".
This might answer your confusions...
04-15-2010 6:09 AM
Hi,
Please check the following code.
DATA:
rows TYPE lvc_t_row,
row_id TYPE lvc_t_roid,
w_row LIKE LINE OF row_id.
CALL METHOD grid->get_selected_rows
IMPORTING
et_index_rows = rows
et_row_no = row_id.
LOOP AT row_id INTO w_row.
READ TABLE t_sflight INDEX w_row-row_id INTO fs_sflight.
perform the necessary operations.
insert fs_SFLIGHT into t_tab index w_row-row_id .
ENDLOOP.
HERE YOU WILL GET THE INDEX WHERE THE OPERATION HAS BEEN PERFORMED ON THE TABLE.
FS_SFLIGHT CONTAINES THE NEW RECORD JUST CREATED.
HERE THE RECORD WILL BE INSERTED IN THE SPECIFIED INDEX OF THE INTERNAL TABLE.
T_TAB IS THE INTERNAL TABLE FOR THE ACTUAL ALV TABLE.
Regards and Best wishes.
07-08-2010 9:20 AM
Thanks for your replies.
I'm sorry - i didn't find time to try the suggested solutions yet, so I just marked your posts as helpful answers - without knowing if they really are.
I close the thread.