I am writing a different solution which might be helpful to you.
add one column keyno in table i_tab.
When you are inserting records in table i_tab, and there are multiple records to append in table i_tab for same key, you can add keyno for each records where same key has multiple records.
For Example:
Insertion of records in Table i_tab
i_tab_line-key = 'X'.
i_tab_line-keyno = 1.
APPEND i_tab_line to i_tab.
i_tab_line-key = 'X'.
i_tab_line-keyno = 2.
APPEND i_tab_line to i_tab.
i_tab_line-key = 'X'.
i_tab_line-keyno = 3.
APPEND i_tab_line to i_tab.
Table i_tab Sorting by Key Keyno descending.
SORT i_tab by key keyno Desc.
Now Read Table will find last matching entry from table i_tab for the key.
read table i_tab with key = X
regards,
Umar Abdullah