Skip to Content
Former Member
Nov 21, 2008 at 05:34 AM

BINARY SEARCH when readign a table


ABAP experts,

I have a question on READ TABLE statement.

I have an internal table say INT_TAB with say 5 fields already filled and 3 more that need to be filled.

I loop at internal table into WA_TAB.

Then I read table INT_TAB2 INTO WA_TAB2

WITH KEY field1 = WA_TAB-field1

AND field2 = WA_TAB-field2



Before reading and before looping I sort INT_TAB2 by both the key fields.

My observation is that when I use BINARY SEARCH, for some recods this field gets populated which is OKAY, but for some records it is blank, I then check in SE16 an find that actually the table-field has a non blank value which should have been read.

However when I remove BINARY SEARCH, it does work, but I feel removing it may slow the processes and hamper performance.