What is Inheritance in SAP OOABAP ?
Inheritance is the concept of passing the behavior of one class to another class.
You can use an existing class to derive a new class.
Derived class inherits the data and methods of a super class.
However they can overwrite the existing methods also add new code. Advantage of this property is re-usability.
This means we can add additional features to an existing class without modifying it.
SUPER is the keyword used to represent the super class in oops, you can access the methods and attributes the super class using this word super.
REDIFINATION is the keyword which is used to overwrite the parent class methods with new definition.
NOTE: In Object Oriented ABAP we have only single inheritance. There is no multiple inheritance.
Inheritance in generalSuper Class Is a main class by using this we can derive a new class which will be called as Child class.
Final Class is a class which can not be used for inheritance, it is a class property (check box under properties of class).
If the final check box is selected, we can not use this class for inheritance, to use inheritance remove the final check box.