SAP MEMORY CONSUMPTION 4



Get Example source ABAP code based on a different SAP table
  



Complex Data Objects with Deep Components
If data objects of complex data types have many deep components, which often, for example, applies to internal tables with a deep line type for example, the administrative costs in the form of memory for references and headers must be prevented from growing disproportionately large compared to the actual data content.
For complex data objects with relatively little data content, three basic cases can be distinguished: Complex data objects with a sparse fill level A complex deep data object is sparsely populated if it contains many deep components of which most are initial. The memory requirement of such a deep initial component like this is 8 bytes for as long as the component does not yet refer to a header. Complex data objects with a duplicative fill level A complex deep data object has a duplicative fill level if it contains many deep components of which most refer to the same data. Such components share the dynamic memory and only contribute to the memory requirement of their references. For dynamic data objects, this is achieved by sharing. Complex data objects with a low fill level A complex deep data object has a low fill level if it contains many deep components that refer to different objects, strings, or internal tables , but the objects only require very little memory or are empty.
Deep data objects with a fill level that is sparse, duplicative, and not too low can usually be used without any concerns.
For deep data objects with a sparse fill level and few duplicates, it is vital to consider the memory requirements for references and headers. Unlike other programming languages, ABAP is not suitable for the massive use of such data objects. If the dataset is low, a class wrapper can also be used as an alternative to internal tables, since the additional costs for objects are comparatively low.

ABAP_EXAMPLE_VX5
An example of a duplicative data object with a low fill level is an internal table whose line type itself is table-like or contains t able-like components. Even if the inner internal tables are initialized after previous use, they still occupy memory for reference and header, which can cause considerable memory requirements for little or no work data in the case of a large outer internal table.
ABAP_EXAMPLE_END

ABAP_EXAMPLE_ABEXA
See Deep Data Objects, Memory Usage.
ABAP_EXAMPLE_END