‎2008 Jan 29 4:29 AM
Hi all,
What does this statment mean (INHERITING).Can some one explain with a simple example(no technical terms).
CLASS ship DEFINITION INHERITING FROM vessel.
ENDCLASS.
Thanks in advance.
Alex.
‎2008 Jan 29 4:58 AM
Hai.
inheriting means inheriting all properties of baseclass to development class.here ship is development class and
vessel is base class.ship can use all attributes ,methods of vessel.
check the links.
http://help.sap.com/saphelp_nw70/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
http://www.beinsoft.com/articles/sap-tutorial-abap-objects.php
http://www.geekinterview.com/question_details/13383
http://www.erphome.net/pdf/tech/J06.pdf
Regards.
Sowjanya.b
‎2008 Jan 29 4:58 AM
Hai.
inheriting means inheriting all properties of baseclass to development class.here ship is development class and
vessel is base class.ship can use all attributes ,methods of vessel.
check the links.
http://help.sap.com/saphelp_nw70/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
http://www.beinsoft.com/articles/sap-tutorial-abap-objects.php
http://www.geekinterview.com/question_details/13383
http://www.erphome.net/pdf/tech/J06.pdf
Regards.
Sowjanya.b
‎2008 Jan 29 5:01 AM
Well, the keyword INHERITING is used for the implementation of INHERITANCE in OO ABAP.
I think what you can do here is look into the concepts of object oriented programming, and then check out syntactically how it is implemented in OO ABAP.
In this example, there is a Parent class (also known as the base class) called vessel.
Vessel consists of certain properties and functionalities common to all types of carrier vessels.
However, when you want a ship, you need certain functionalities and properties specific to a ship. Say, for example, the number of passengers it can accomodate.
But you would want to restrict your coding to incorporate only the specifics of the ship, but would want other properties to be 'derived' or obtained from the vessel.
That is when you use the concept of inheritance.
Another example:
Say you want to implement a series of figures, like a circle, rectangle, square and so on.
Basically you would maintain a 'FIGURE' class as a base, and keep the general properties there. For example 'colour' of the figure.
How you draw a square is different from how you draw a circle, so that specifics you would maintain in the class for SQUARE and for CIRCLE.
You would probably design that CIRCLE and SQUARE inherit from FIGURE.
‎2008 Jan 29 5:32 AM
Hi,
INHERITING means inherit... means take the some properties of another class.
Example in real time: Suppose u have some properties of your father. This is Inheriting or Inheritance.
Your Father is Supper Class and you are sub class of your father.
--Ranveer