SAP CLASS TYPES CONSTANTS



Get Example source ABAP code based on a different SAP table
  



ABAP_OBJ - Data Types and Constants of Classes
ITOC

Data Types

Standalone Types
The TYPES statement can be used to declare any number of user-defined ABAP data types within a class. Types are instance-independent and only exist once for all the objects of a class.
BEGIN_SECTION VERSION 5 OUT
In particular, it is possible to define data types in the public visibility section of global classes, which makes the use of type pools in this context obsolete.
END_SECTION VERSION 5 OUT

Bound Data Types
Bound data types that occur as properties of instance or static attributes also belong to the static properties 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 first creating the object.

Constants
Constants are special static attributes , whose values are specified when they are declared, and which cannot be changed. Constants are declared using the statement CONSTANTS. Constants are instance-independent and exist only once for all the objects of a class.
BEGIN_SECTION VERSION 5 OUT
In particular, it is possible to declare constants in the public visibility section of global classes, which makes use of type pools in this context obsolete.
END_SECTION VERSION 5 OUT