I have an editable OO ALV where I over ride the standard functionality for append, insert, Delete etc to handle condition that when a new row is inserted/appended its status which is in a non-editable cell is defaulted to some value. Now the logic is as follows
1.User clicks on append button(which we have overridden) I capture it in user command and append a blank row at end with default status in itab and do a grid->refresh_table_display()
2.User enters values in all cells and presses ENTER , control goes to handle_data_changed method I validate and check the modified rows from ER_DATA_CHANGED->MOD_ROWS or ER_DATA_CHANGED->MOD_CELLS and update my itab with the values entered on screen and again do a grid->refresh_table_display() so the values are displayed again on the screen.
Problem is when I give a SORT criteria or press sort say according to Year (descending) if grid already contains 2 rows and we add 3rd row with year 2009 at bottom
Amount Year Status
100 2007 Old
200 2006 Old
300 2009 New
Then on ENTER the 3rd row goes to 1st place as it should but the values on the 3rd row do not change!!! eg see below
Amount Year Status
300 2009 New
100 2007 Old
300 2009 New
The problem is only when the ALV is sorted & I have a unique row index in my itab to keep track of records. I feel this is a mismatch in the frontend and backend update. Any body else have a clue why is this happening only on sort ?