5/1/2023 0 Comments Oops programsIf we declare them protected, they can only be accessed by inheriting classes.When we declare them private, they cannot be accessed by any class.If we declare them public, they can be accessed by any class.The access specifiers – public, private and protected – work the same way as they do for class access specifiers Methods and attributes can be accessed by objects of the classĢ. We can define a method using METHOD and ENDMETHOD statementsĮNDMETHOD Accessing Attributes and Methods in SAP ABAPġ.Method definition may or may not contain parameters, which are passed when the method is called.It contains actions to be performed by objects that call upon the class.A method can access any characteristic of a class.It is the behaviour of the object of a class.Static: this includes common state of the class to be shared by all instances of class, hence when we change one state then all other objects can see the change, declared by CLASS-DATA statement.Instance: this includes the instance-specific state of object, the changes are different for all objects, and this is declared by DATA statement.We must declare attributes in class declaration section.They can have any pre-defined data type like P, F, I, etc.Attributes are the characteristics of the class.What this means is, we can define who all can have access to particular data of a classĮxample – CLASS dataflairclass DEFINITION.Įxample – CLASS dataflairclass IMPLEMENTATION.We also define and declare function modules in a class.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |