SAP CLASS ATTRIBUTES
Get Example source ABAP code based on a different SAP table
ARTICLE
Attributes
Attributes are data objects of any ABAP data type that are internal to 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 are therefore part of the interface between objects and their users. To encapsulate the status of the object, you need to use protected, package-visible, or private attributes. You can also restrict the changeability of non-private attributes using the
Instance Attributes
The content of instance attributes forms the instance-dependent status of the object. Instance attributes are declared using the
Static Attributes
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
Data Types of Attributes
The data types of all attributes, including instance attributes and in particular
Example
Reference to the data type of an instance attribute
Attributes declared as structures can be declared as