Skip to Content
author's profile photo
Former Member

error while redefining a class method derived from superclass

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Posted on Jul 15, 2004 at 05: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

    Add comment
    10|10000 characters needed characters exceeded