Data Types and Constants

Data types

Independent types

The TYPES statement can be used to define any number of your own ABAP data types within a class. Types are not instance-specific and are only available once for all the objects in the class.

As of release 6.40, it is possible to define data types in the public visibility section.

Bound data types

Bound data types that occur as properties of instance or static attributes also belong to the static attributes of a class. After a LIKE addition, the class name can be used to access the properties of instance attributes (exceptions to this rule are the statements ASSIGN ... CASTING and SELECT-OPTIONS ... FOR). In addition, a reference variable can be used with an object component selector without the object having previously been generated.

Constants

Constants are special static attributes, whose values are specified when they are declared and which cannot be changed later. Use the CONSTANTS statement to declare constants. Constants are not instance-specific - they only once for all the objects in the class.

As of release 6.40, it is possible to define constants in the public visibility section of global classes.