BINARY SEARCH in read table statement

1.for standard table, it must be sorted by search key.
2.for sorted table , binary search is used automatically when searching with/include table key. 

Note:with a binary search (addition BINARY SEARCH is used for standard tables, automatically for sorted tables), if there are several hits (because of an incompletely specified search key or because there are duplicate entries in the table), then the first hit in terms of the sequence of the rows is always returned, that is, the row with the smallest index.

        using binary search,if there is no records hitted , then sy-subrc is set to 4, sy-tabix is set to 1,
        if there is no record hitted and  the end of the table was reached, sy-subrc is set to 8, sy-tabix is set to lines of table + 1.
上一篇:No.004:Median of Two Sorted Arrays


下一篇:scala vs java 相同点和差异