S OneStopSAP
← All articles ABAP

SAP ABAP - Use of Binary Search Option

Published November 13, 2009

Use of binary search option

When a programmer uses the read command, the table is sequentially searched. This slows down the processing. Instead of this, use the binary search addition. The binary search algorithm helps faster search of a value in an internal table. It is advisable to sort the internal table before doing a binary search. Binary search repeatedly divides the search interval in half. If the value to be searched is less than the item in the middle of the interval, the search is narrowed to the lower half, otherwise the search is narrowed to the upper half.

Not Recommended

Read table int_fligh with key airln = 'LF'.

Recommended

Read table int_fligh with key airln = 'LF' binary search.

Share

Cookies on OneStopSAP

We use cookies for session handling and anonymous traffic analytics. No third-party tracking, no profiling.

Privacy →