Hi Navi,
Whenever you update data back to the context by manipulating internal table of alv, the on_data_check will not trigger as it sets data via code at runtime. Hence losing the track of user modified data information.
Are you able to meet your requirement after commenting the lines of internal table manipulation?
Regards,
Rama