Attributes are internal data objects of any ABAP data type within a class. The content of the attributes specifies the status of the object. You can also define reference variables, which you can then use to create and address objects. This allows objects to be accessed within classes.
Attributes are defined in the declaration part of a class. Public attributes are completely visible from outside the class and as such are part of the interface between objects and their user. To encapsulate the status of the object, you need to use protected or private attributes. You can also limit the changeability of attributes using the READ-ONLY addition during the declaration.
The content of instance attributes forms the instance-specific status of the object. Instance attributes are declared using the DATA statement. You cannot use the COMMON PART addition in classes.
The content of static attributes forms the instance-independent status of the object, which is valid for all instances of the class. Static attributes are available once for each class. They are declared using the CLASS-DATA statement and are retained throughout the entire runtime. All the objects within a class can access its static attributes. Changes to a static attribute in an object are visible to all other objects within that class.
The data types of all attributes including the instance attributes and in particular the bound data types belong to the static properties of a class. Therefore, in a LIKE addition, you can use the class component selector or reference variables to refer to the visible attributes of a class without first creating an object. In this way, the access to the properties of the public static attributes of global classes is possible in each program.
Reference to the data type of an instance attribute attr of a global class cl_global.