‎2006 Mar 24 8:23 AM
Hi
In ABAP
I have a Parent class with a method parent_method().
Child class in inheriting from Parent and redefining the parent_method().
In my z_program
I am creating a object of Child class and i want to access the parent_method in the Parent class.
Restrictions:
==>I don't want to call the child class method and then from there call the super class method.
regards
Murugesh
‎2006 Mar 24 10:49 AM
Murugesh,
Did you try Super->parent_method?
Regards,
Ravi
Note : Please mark the helpful answers
‎2006 Mar 24 11:13 AM
Hi Guys,
Thanks ...
As i had mentioned that i don't want to call the child method that inturn will call super->parent_method.
Is there any otherway of doing it?
Thanks
Murugesh
‎2006 Mar 24 11:20 AM
Hello Murugesh,
The keyword SUPER points to the Superclass directly. It is <b>not</b> routed through the subclass.
However, the SUPER keyword can only be used within a method of the subclass.
Regards,
Anand Mandalika.
‎2006 Mar 24 11:27 AM
Murugesh,
Unless its inside the code of child method, it will not know which class is the parent class. Other wise you will have to find out manually which is the super class and call the method. But again I am not sure if you can specify the name of the class dynamically !
Regards,
Ravi
‎2006 May 08 4:53 AM
Hi,
I trying to use something like this,
child->method2();
method2()"child class method.
{
super->parent_method().
}
i got an error saying that we can't call like this..which is possible in case of JAVA.
regards
Murugesh
‎2006 Mar 24 11:05 AM
Hello Murugesh,
The following link shows you how to do that -
http://help.sap.com/saphelp_46c/helpdata/en/1d/df5f57127111d3b9390000e8353423/frameset.htm
Regards,
Anand Mandalika.