Skip to Content
author's profile photo Former Member
Former Member

error while redefining a class method derived from superclass


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.


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

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


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.