06-02-2004 9:30 PM
Hi,
I am not very familiar with ABAP. when am redefining a method of a class which is derived from a superclass in BW, i'm getting an error saying that the method is already defined.
these are the steps i followed.
1. create a class
2. after creating class, click on attributes tab and select superclass and assigned superclass in this field.
3. after inheriting all methods of its superclass, click on methods and select the method (method1) and click on "redefine" icon. I had put necessary ABAP code on the next screen.
4. when am activating, I'm getting an error that says the method (method1) is already defined with options "activate anyway", "process errors", "cancel".
I'm getting desired result if i select "process anyway", but am not sure if the error might cause other problems even after i activate the erroneous method.
thanks
07-15-2004 6:00 PM
Hi hari143,
in ABAP Objects you can only override instance methods, not class methods. So your assumption that you might get into trouble later if you compile the coding could be true.
If your class does not need more than one instance (for example, because it is stateless or contains only class methods), a singleton is a viable alternative.
Maybe this clarifies things a little bit...
Best regards
Joerg