|
Binary search on an internal table which has both ascending
and descending order sorted fields.
DATA(rnd) = cl_abap_random_int=>create( seed = + sy-uzeit min = 1 max = 100 ). DATA: BEGIN OF line, a TYPE i, b TYPE i, c TYPE i, d TYPE i, END OF line, itab LIKE TABLE OF line WITH EMPTY KEY. DO 10000 TIMES. itab = VALUE #( BASE itab ( a = rnd->get_next( ) b = rnd->get_next( ) c = rnd->get_next( ) d = rnd->get_next( ) ) ). ENDDO. SORT itab BY a b ASCENDING c d DESCENDING. READ TABLE itab INTO DATA(wa) WITH KEY a = 10 b = 10 BINARY SEARCH. BREAK-POINT. |
|
See Also
Get help for your ABAP problems
ABAP Books
More ABAP Tips
SAP ERP Modules, Basis, ABAP and Other IMG Stuff All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|