TutorialsPoint-Introduction of OOABAP (SE24) | Class, Object | SAP ABAP | #redmi note 8
What is Object Oriented ABAP ?
- SAP OO-ABAP is object oriented programming approach to ABAP developed by SAP and traditional approach is now becoming obsolete.
- Mainly focuses on the object rather than the code flow.
- All the application are going to build by SAP in abap objects, so it is very essential for every abap developer to learn this new object oriented ABAP.
- All the concepts will be on classes and objects which are very near to the real life scenarios.
#Today don't miss the sale redmi note 8 at 12 noon.
Where we need to focus on OO-ABAP ?
Objects :
- It’s a working entity of a class. Each object is unique at its own, meaning with unique identity and attributes.
- Attributes defines the state of an object whereas behavior of an object refers to the changes that occur in its attributes over a period of time.
- An object can be associated with the class by declaring it with the same data type as of the class within which an object has been created.
An object has three characteristics
- Has a state.
- Has unique identity.
- May or may not display behavior.
Class :
Here class is a user defined data type which is like a blueprint of an object that binds similar types of data. Following are the component of class :
- Attributes – It can be variable or constant as per defined by the user which is declared within the class and can be accessed by all the methods of that class.
- Method – Determines the behavior of an object, it provide some functionality. A method can access all the attributes of their class.
- Events – A mechanism through which one method can raise method of another class.
- Interface – Independent structure which are used in a class to extend functionality of a class.
- Alias – A concept of providing alternate method name for interface method in an implemented class.
#Today don't miss the sale redmi note 8 at 12 noon.
Instance components(->) : These components exist separately in each instance (object) of the class and are referred using instance component selector using
Instance components(->) : These components exist separately in each instance (object) of the class and are referred using instance component selector using
->.
Static components(
=>
) : These components exists globally for a class and are referred to using static component selector =>
.- Each class component has a visibility.
The whole class definition is separated into three visibility sections in ABAP objects:
- PUBLIC .
- PROTECTED .
- PRIVATE.
Public section: Data declared in public section can be accessed by the class itself, by its subclasses as well as by other users outside the class.
Protected section: Data declared in the protected section can be accessed by the class itself, and also by its subclasses but not by external users outside the class.
Private Section: Data declared in the private section can be accessed by the class only, but not by its subclasses and by external users outside the class.
SAP ABAP Object Oriented programming is having two ways to implement Class
- Global Class :
- Local Class :
Local classes are classes which are available in ABAP programs, we can access them via ABAP editor SE38.
Go on next blog for creating global class in SE24.
Go on next blog for creating global class in SE24.
THANK YOU FOR READING
Comments
Post a Comment