Attributes Example
Attributes Example
"1. definition
"2. Implementation
"3. Creating the instance of the class
"4. Access the variable/methods using the instance/class
PUBLIC SECTION.
TYPES ty1 TYPE i.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
ULINE.
FORMAT COLOR 1.
*write:/ lcl_abc->lv1.
*write:/ lcl_abc=>lv1.
ULINE.
FORMAT COLOR 3.
WRITE:/ 'Access the all the attributes using onject reference for obj2'.
obj2->lv1 = 500.
WRITE:/ obj2->lv1. "instance attribute
WRITE:/ obj2->lv2. " static attribute
WRITE:/ obj2->lc1. "constant
obj3->lv1 = 500.
obj3->lv2 = 1000.
WRITE:/ obj3->lv1. "instance attribute " 500
WRITE:/ obj3->lv2. " static attribute "1000
WRITE:/ obj3->lc1. "constant 50
FORMAT COLOR 3.
WRITE:/ 'Access the all the attributes using onject reference for obj3'.
FORMAT COLOR 3.
WRITE:/ 'Access the all the attributes from the global classzcl_attributes'.
WRITE:/ 'Access the all the attributes from the global classzcl_attributes after
creation of obj4'.
obj4->mv1 = 3500.
obj4->mv2 = 4500.