Ansicht
Dokumentation

ABENCOMPLEX_TYPES - COMPLEX TYPES

ABENCOMPLEX_TYPES - COMPLEX TYPES

BAL_S_LOG - Application Log: Log header data   General Data in Customer Master  
This documentation is copyright by SAP AG.
SAP E-Book

Working with Complex Types

Complex types can be made up of either elementary types or from other complex types. For example:

  • Structures can contain components of any type
  • Internal tables can be defined from any line type

The fact that structures can contain components of any type means, in particular, that:

  • Structures can contain sub-structures (nested structures)
  • Tables can be components of structures (deep structures)

The fact that internal tables can be defined using any line type allows you to create:

Daß interne Tabellen über Zeilen beliebigen Typs definiert werden können, erlaubt insbesondere die Vereinbarung von

  • Tables of unstructured line types (dynamic arrays of elementary types)
  • Tables of structures with tabular components (tables with a deep line type)
  • Tables of tables

Complex data types allow you to model complex data objects. You can aggregate fields, structures, and internal tables in one declaration. The inner structure of the data object can be encapsulated so that interfaces can be more streamlined.

Internal tables that are part of a complex data object never have a header. This allows you to define basic operations on any data object in an uncontrived way. Only internal tables at the top level of an object can (but need not) have a header.n aber nicht) eine Kopfzeile haben.

If itab is an internal table with a header, you can address the table body using itab[].

Basic universal operations

Complex data types and objects are integrated seamlessly in the ABAP language. SAP has defined a range of operations that can be performed on any data object. The semantics for complex data objects are uncontrived because they are based on the equivalent operations on elementary objects.

At present, the following ABAP statements have been defined for use with any data object:

MOVE for structures entails a assignment component-by-component. MOVE for internal tables entails copying the content of the table (that is, "deep copy" as opposed to a "shallow copy").
  • Comparisons using:

  • Sorting (SORT) and

Two structures are considered equal if each component is of the same type. A structure is considered smaller than another if it contains the first smaller component in the predefined component order.
Two internal tables are considered equal if they have the same number of lines and are identical line-by-line in the predefined line order. A table is considered smaller than another if it has fewer lines, or if it has the same number of lines but contains the first smaller line in the predefined line order.
  • Reset to initial (CLEAR):
For structures, CLEAR entails a component-by-component reset. For internal tables, it is the same as the REFRESH statement.
You can pass any data object using the USING and CHANGING parameters in the FORM / PERFORM statement, and by using IMPORTING and EXPORTING parameters in the FUNCTION / CALL FUNCTION statements.
Field symbols can point to any data object, particularly to an internal table.
You can use the EXPORT/IMPORT interface to store any data object (in main memory) on the database.

Moreover, you can perform any of the following table operations on internal tables with any line type:

(APPEND, COLLECT, INSERT, MODIFY, DELETE, REFRESH, FREE, READ, SORT, LOOP, AT NEW / AT END OF, SUM) .






CL_GUI_FRONTEND_SERVICES - Frontend Services   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 6341 Date: 20240426 Time: 094839     sap01-206 ( 75 ms )