The sorting of ALV table affects the order of the internal table lines.
That's how it works.
If you want to know the initial order, then you have to add an additional tehnical field (hidden, TECH='X' in field catalog) in your internal table, containing the initial order.
This way you may reorder the lines of the internal table when the ALV is closed.