No secondary index => linear search
* Entries: 1000, Line width: 100
* Key width: 20
* The READ locates the 500th entry.
READ TABLE ITAB INTO WA
WITH KEY DATE = SY-DATUM.
IF SY-SUBRC = 0.
" ...
ENDIF.
Binary search using secondary index
* Entries: 1000, Line width: 100
* Key width: 20
* The READ locates the 500th entry.
READ TABLE SEC_IDX INTO SEC_IDX_WA
WITH KEY DATE = SY-DATUM
BINARY SEARCH.
IF SY-SUBRC = 0.
READ TABLE ITAB INTO WA
INDEX SEC_IDX_WA-INDX.
" ...
ENDIF.
Documentation
If you need to access an internal table with different keys
repeatedly, keep your own secondary indices.
With a secondary index, you can replace a linear search with a
binary search plus an index access.