Data Types

Data types are mere type descriptions with no memory involved. A data type characterizes the technical properties of all data objects that have this type. Data types occur as attributes of data objects but can also be defined independently.

The definition of independent data types builds on a set of predefined data types. It can be included in the declaration part of a program using the statements TYPES or defined generally in the ABAP Dictionary. Independent data types can be used to declare data objects and for type checks in generic operations.

Data types are a subtree of the ABAP type hierarchy:

Hierarchy of ABAP data types


Data types  ---- elementary ----fixed length---- C
             |               |               |-- N
             |               |               |-- D
             |               |               |-- T
             |               |               |
             |               |               |-- X
             |               |               |
             |               |               |-- P
             |               |               |-- I
             |               |               |-- F
             |               |
             |               |-- var.length ---- STRING
             |                               |-- XSTRING
             |-- reference types
             |
             |-- complex   ---- structured

Data types are subdivided into elementary types, reference types, and complex types.

  1. four character-type types: character fields (C), numeric character fields (N), date fields (D), time fields (T)
  2. X for byte fields with hexadecimal display
  3. three numeric types: integer (I), floating-point numbers (F), and packed numbers (P)

  1. STRING for character strings
  2. XSTRING for byte sequences

  1. the line type, which can be any elementary data type, a reference type or complex data type
  2. a key to identify the table lines. It can be built up from the elementary fields of the lines. Distinction is made between unique and non-unique keys.
  3. the access type that defines how ABAP accesses the table. With respect to the access type, distinction is made between sorted and unsorted index tables and hash tables.

    Internal tables are always used when multiple data of a fixed structure are used within the program.

For further information refer to Data Types in the SAP Library.