Data Types and Data Objects 

Programs work with local data. Data consists of strings of bytes in the memory area of the program. A string of related bytes is called a field. Each field has an identity (a name) and a data type. All programming languages have a concept that describes how the contents of a field are interpreted according to the data type.

In the ABAP type concept, fields are called data objects. Each data object is an instance of an abstract data type. Data types in ABAP are not just attributes of fields, but can be defined in their own right. There are separate name spaces for data objects and data types. This means that a name can at the same time be the name of a data object as well as the name of a data type.

Data Types

As well as occurring as attributes of a data object, data types can also be defined independently. The definition of a user-defined data type is based on a set of predefined elementary data types. You can define data types either locally in the declaration part of a program (using the TYPES statement) or globally in the ABAP Dictionary. You can use your own data types to declare data objects or to check the types of parameters in generic operations.

Data objects

Data objects are the physical units with which ABAP statements work at runtime. Each ABAP data object has a set of technical attributes, which are fully defined at all times when an ABAP program is running. The technical attributes of a data object are its length, number of decimal places, and data type. ABAP statements work with the contents of data objects and interpret them according to their data type. You declare data objects either statically in the declaration part of an ABAP program (the most important statement for this is DATA), or dynamically at runtime (for example, when you call procedures). As well as fields in the memory area of the program, the program also treats literals like data objects.

 

Data Types

Data Objects

 

Further information about data types and data objects:

Compatibility

Determining the Attributes of Data Objects

Examples of Data Types and Objects