Skip to Content
Former Member
Jun 06, 2008 at 07:28 AM

READ statement with binary search


Hi friends,

I know that while using the READ statement that we have to sort data and use BINARY SEARCH for faster search.

I have a situation

following are internal table contents

belnr agent action

9000001 name1 BRW

9000001 name1 API

when i use READ statement with where condition ( ( belnr - 9000001 ) and ( action = 'BRW' ) ) with binary search then the SY_SUBRC value is 4.

if i remove the binary search then its giving SY-SUBRC value 0.

Can anybody explain why BINARY SEARCH fails.

Points will be rewarded for correct answers.

Thanks and regards,