Start of Content Area

Data Types and Data Objects  Locate the document in its SAP Library structure

Programs work with local program data – that is, with byte sequences in the working memory. Byte sequences that belong together are called fields and are characterized by a length, an identity (name), and – as a further attribute – by 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 thus an instance of an abstract data type. There are separate name spaces for data objects and data types. This means that a name can be the name of a data object as well as the name of a data type simultaneously.

Data Types

As well as occurring as attributes of a data object, data types can also be defined independently. You can then use them later on in conjunction with a data object. 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 TYPESstatement) 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. The contents of a data object occupy memory space in the program. ABAP statements access these contents by addressing the name of the data object and interpret them according to the data type.. For example, statements can write the contents of data objects in lists or in the database, they can pass them to and receive them from routines, they can change them by assigning new values, and they can compare them in logical expressions.

Each ABAP data object has a set of technical attributes, which are fully defined at all times when an ABAP program is running (field length, number of decimal places, and 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.

 

For more information, refer to the following chapters:

Data Types

Data Objects

Built-In Data Types and Data Objects

Generic Data Types for Typing

Local Program Data Types and Data Objects

 

End of Content Area