Hi Rohan,
After selection of rows from ALV take selected key values into internal table. after sort function before loading the page read ALV data with internal table data for index values for the previously selected values. then you can use set_selected method for selecting a row. Make sure that internal table should not refresh when you refresh the page.
Thank you
Ajay