February 21, 2016

Internal tables in ABAP Part 2

In the last post we showed what are internal tables, how many types are and how they are accessed. These data structures are habitually used to handle data in a program and without these it wouldn't be possible to manage information from transparent tables and even internal structures.

However it's necessary to know when to use these types, for example; the standard tables are the only data structure that can be used in ALV grids but they also are not adviced for performance in a large amount of information.

The access on STANDARD tables are sequential, so the search will be linear in relation with its size. On the other hand, you can make use of the SORT command and then search in the table with BINARY SEARCH. Another way could be using the INDEX which is a very fast key access.

Depending on the size of the table the search can be very fast but with so many tuples the performance can be affected.

If you want to gain the most on performance in big tables it is recommended to use SORTED and/or HASHED tables. In both you must define a key but in the SORTED one you can create a NON-UNIQUE KEY.

The key access in SORTED table is logarithmical, that means that the performance is affected very little when reading large amount of data.

HASHED tables use a hash algorithm promising a constant access time to find a tuple.

Have in mind that all the internal tables work on memory and that they have limits and if you don't manage them appropiately you could end up with a short dump because of memory resources.

The key here is efficiency, how could you bring the most of the internal tables? Making a good choice when dealing with these structures. For example


Please Share it! :)

No comments :

Post a Comment