Register Login

Difference between WITH KEY and TABLE KEY

Updated May 18, 2018

WITH KEY vs. TABLE KEY

Hello Experts,

What is the difference between withkey and tablekey in ABAP?

Please suggest me with a proper solutions?


Comments

  • 30 Apr 2014 8:52 am rekha Helpful Answer

    WITH TABLE KEY, is used for faster binary search. Binary search is one of the fastest way to find the record exists in the internal table. For the binary search, the table must be sorted by the specified search key in ascending/descending order.

    Otherwise the search will not find the correct row. 

    When normal linear search is used and no field contained in the keys then WITH KEY is used. 

    We can pass key field of non key field and it is determined through the content of data object key for which a flat character-type data type is expected. It consider only standard table key field.


×