‎2006 Apr 21 6:03 PM
how does for all entries and binary search operation works . what r there prerequistes.
‎2006 Apr 21 6:06 PM
FOR ALL ENTRIES:
1.You must ensure that the itab is not empty, otherwise your SELECT will be a complete scna of the db table
2. If you expect duplicate entires to be selected from the db table, you must select all the key fields in your SELECT statement.
BBINARY SEARCH:
The itab must be sorted by the key fields you READ the table with. ie
SORT ITAB BY FIELD3.
read table itab with key field3 = 'XXXX'
binary search.
Regards,
Suresh Datti
‎2006 Apr 21 6:06 PM
FOR ALL ENTRIES:
1.You must ensure that the itab is not empty, otherwise your SELECT will be a complete scna of the db table
2. If you expect duplicate entires to be selected from the db table, you must select all the key fields in your SELECT statement.
BBINARY SEARCH:
The itab must be sorted by the key fields you READ the table with. ie
SORT ITAB BY FIELD3.
read table itab with key field3 = 'XXXX'
binary search.
Regards,
Suresh Datti
‎2006 Apr 21 6:07 PM
ALL ENTRIES ..
If you want to fire a SELECT for each row of a internal table, then instead of calling the SELECT inside the loop of the internal table, you use the ALL ENTRIES so that the SELECT fires for each row. Pre-requisite is that internal table should have data, other wise it will fetch all the data and might cause performance issues
BINARY SEARCH ..
This is to improve the performance of a READ statement on a internal table. You will have to declare the table as a SORTED table and then use the BINARY SEARCH option on the SORTED field.
Regards,
Ravi