Structured Data Types

In general, structured data types in ABAP programs are user-defined.

There are no predefined structured data types you can use in ABAP with the exception of the following:

You can use the predefined generic table type TABLE to pass an internal table with a generic line structure to a subroutine (see Typing Formal Parameters) or to type a field symbol (see Typing Field Symbols).

There are two kinds of structured data types:

A structure is a collection of other data types. The components of structures can themselves be structures or internal tables.

You define structures using the TYPES or DATA statement (see The DATA Statement for Structures).

With the DATA statement, you do not define a standalone data type, but a data object with a structured type.

An internal table consists of several lines of the same type. Unlike structures, which extend only 'horizontally', internal tables also extend 'vertically'.

You define internal tables with the OCCURS parameter of the TYPES or DATA statements (see Creating Internal Tables).

Since structures can contain components of any type and internal tables can be defined for any type, user-defined data structures can become very complex.

Examples of Structured Data Types

The following are examples of structured data types in ABAP

    1. structures, which consist of a series of elementary data types (flat structures, only ‘horizontal’)
    2. internal tables defined for elementary fields (dynamic arrays of elementary data types, only 'vertical')
    3. internal tables defined for simple structures (tables with lines and columns)
    4. structures containing sub-structures (nested structures)
    5. structures containing internal tables as components (deep structures)
    6. internal tables defined for structures which contain structured components (tables of deep line type)
    7. internal tables defined for structures which contain internal tables as components