If I get you correctly, you want to have the last record of a table.
what you can do is this:
- Select the table into an internal table
- Use the command DESCRIBE TABLE tab_name
- Then the number of records will be in variable sy-tfill, so just use the command:
READ TABLE INTO <something> INDEX sy-tfill.