Overwriting inherited method of a class

Hi all,
http://help.sap.com/saphelp_erp2004/helpdata/en/65/d4463c9c9ffc3ae10000000a114084/frameset.htm
As given in the above link I inherited the class CL_BSP_CONTROLLER2. When I try to overwrite a method called DO_REQUEST I'm prompted for an access key.
Did I miss something?
Regards
Noufal

You have to click on the button called "<b>Redefine</b>" which is between "<b>Find Next</b>" and "<b>Undo</b>".
Regards
Raja

Similar Messages

  • Inherited methods of super class not shown in outline

    Hello, is there a possibility to display the methods and variables from the super class in the outline of the inheriting class in AiE?

    Hi Christian,
    We had discussed this, when we implemented the outline and quick outline some years, ago. Finally, we sticked to the approach that is used by other plug-ins in Eclipse (like JDT).
    There Outline View shows only the content of the current editor. This helps to keep the content of the view stable when you select an element for navigation (because you won't be able to switch the editor by selecting an element ).
    Inherited members are usually part of other editors, unless you have redefined a method in your current class. Therefore, they are not shown in Outline View (unless they are redefinitions).
    The filters like "Hide Non-Public Members of classes" can only hide elements of the current editor.
    Inherited members can be shown in the Quick Outline, because the interaction pattern is different there: If you navigate to an element the pop-up is closed. Therefore, a content change of the Quick-Outline does not hurt.
    Michael

  • Redefinition / Overwriting of inherited method using class-builder

    Hi,
    I have a class which inherits some methods from it's baseclass. I want so overwrite ( re-define ) some of the methods from the baseclass using se80 / se24.
    How can this be done ?
    Best Regards,
    Frank

    Hi,
    <b>go se80</b> 1) enter the class name which u have inherited from the base class
    2) in the herarchy ...methods---->Inherited Methods
    3) right click on the method which u have to redifine.
    4) select redifine option.
    5) ur method will be placed under redifination list.
    6) go write the code
    note :- U cannot redifine final Method...Appropriate message will be shown
    save and activate.
    Mark Helpful answers
    Message was edited by: Manoj Gupta

  • Error message while creating Overwrite exit for a standard class method.

    Hi,
       I was trying to create an overwrite exit in class CL_HRTMC_AC_TA_DASHBOARD for method GET_DEVPLAN_ASSESSMENTS. I created an Enhancement Implementation first. But when I tried to insert Overwrite exit method, I got error message that "The class has not yet been converted to the new class-local types" . In the toolbar->Utilities, I saw an option "Convert Class-local types" and when I clicked that it asked for the Access key. Eventhough I cancelled the process, now I am seeing some inactive parts in from this class in my Inactive object list. When I try to activate, it's again asking for access key and not able to activate it.  Not sure what has actually happened. Is it possible to revert it to old form? Please advice!
    Thanks,
    Mahesh Nair.

    Inbound delivery is not part of Sales and Distribution. You might want to move your post to either the Logistics Materials Management (MM) forum or the Workflow forum.
    Also sometimes search for OSS notes by the message class and number helps.

  • Overwriting a method of a super class in the subclass ???

    Hi,
    can somebody tell me whether it's possible to add a new implementation of a method in the sub class which is inherited from a super class?
    I want to model my program in that way:
    1. I define a super class with some implemented methods.
    2. This class should be inherited in a sub class. One method should be used as it was implemented in the super class but another method should be overwritten in the subclass.
    I know this concept from Java but I couldn't find a way how to do it in ABAP
    Many thanks for any help!
    Best regards,
    Birgit

    hi,
    yeas you can do it,
    Subclass can re-implement  the inherited public and protected methods from superclass.Class C1 contains method METH1(public) and METH2(protected), both of which are modified and re-implemented in  its subclass C2.also you can have ur own methods in subclass.Objects are created out of both classes and the method METH1 for both objects are called.
    Output of the program demonstrates different behaviour for method METH1 of class C1 and C2.
    This demonstrates the theme.
    REPORT YSUBDEL.
    CLASS C1 DEFINITION.
      PUBLIC SECTION.
       METHODS : METH1.
      PROTECTED SECTION.
       METHODS METH2.
      ENDCLASS.
    CLASS C1 IMPLEMENTATION .
      METHOD : METH1.
       WRITE:/5 'I am meth1 in class C1'.
       CALL METHOD METH2.
      ENDMETHOD.
      METHOD : METH2.
       WRITE:/5 ' I am meth2 in class C1 '.
      ENDMETHOD.
    ENDCLASS.
    CLASS C2 DEFINITION INHERITING FROM C1.
    PUBLIC SECTION.
      METHODS : METH1 redefinition,
      meth3.
    PROTECTED SECTION.
      METHODS : METH2 redefinition.
    ENDCLASS.
    CLASS C2 IMPLEMENTATION.
    METHOD METH1.
       WRITE:/5 'I am meth1 in class C2'.
       call method meth2.
    endmethod.
      METHOD : METH2.
      WRITE:/5 ' I am meth2 in class C2 '.
    ENDMETHOD.
    METHOD : METH3.
      WRITE:/5 ' I am own method of class C2'.
    ENDMETHOD.
    endclass.
    START-OF-SELECTION.
      DATA : OREF1 TYPE REF TO C1 ,
             OREF2 TYPE REF TO C2.
      CREATE OBJECT :  OREF1 , OREF2.
      CALL METHOD : OREF1->METH1 ,
                    OREF2->METH1.
    hope it helps,
    regards

  • ABAP Objects : calling one method from another class

    Hi,
    Can you please tell me how to call method from one class or interfce to another class.The scenario is
    I have one class CL_WORKFLOW_TASK, this class have interface IF_WORKFLOW_TASK & this interface have method IF_WORKFLOW_TASK~CLOSE. Now my requirement is ,
    There is another class CL_WORKFLOW_CHAIN ,this class have interface IF_WORKFLOW_CHAIN & this interface have method IF_WORKFLOW_CHAINCLOSE_ALL_PREDECESSORS. Now i have to write my code in this method but i have to use IF_WORKFLOW_TASKCLOSE method for closing the task.
    Can you please give me the code for the above .
    Please waiting for reply.

    Hi,
    You can use the concept of INHERITANCE  in this scenario.By using this concept, you can call all the public and protected  methods of class CL_WORKFLOW_TASK  in the required calss CL_WORKFLOW_CHAIN as per your requirement.
    Go through the  Introdctory(INHERITANCE) programming from this SAPHELP link.
    http://help.sap.com/saphelp_nw70/helpdata/en/1d/df5f57127111d3b9390000e8353423/content.htm
    I hope, it will help in you inresolving your problem.
    by
    Prasad GVK.

  • How can I access the protected inherited method

    Hi guys:
    I know I can use getDeclaredMethod to get some methods,but my question how can I get a protected inherited method? for example
    class A{
    protected void test(){}
    class B extends A{
    public String getValue(){}
    class C{
    public static void main(Strin[] args){
    //at here I want to access "test" method by reflection,but I dont know how?
    thanks advance!

    Indeed it does. If you want to find the declared methods of the superclass then you should be able to figure out how to do that: find the superclass, find its declared methods.

  • Referencing a method in one class from a constructor in another?

    Hi,
    I'm not sure whether this is a simple question or not, but instead of rewriting the method in another class, is there a way that I can reference that method, eg:
    public int getTitleCode() {
            return titleCode;  }within the constructor of another class. I don't want to use inheritance with this because it would change all my existing contructors.
    Any ideas how to do this, or is it just simpler to add the method to both classes?
    Many thanks!

    Hi,
    I'm trying to use a method, defined in Class A, within one of the constructors in Class B. Class B object represents a copy of the output of Class A, with the addition of a few extra methods.
    Therefore to represent the details correctly in the saved text file for class B, I need to call a method from class A to save the text file for class B correctly.
    Class B saves a file with a reference number unique to that class, plus a reference number that is also saved in the text file for class A.
    I can achieve the correct result for the above by having the same method in both classes, but I just wondered whether instead of this I could in fact call the method from class A in the constructor for class B. With the following code,
        referenceNumber = refNum;
            titleReferenceNumber = titleRefNum;
            titleRefNum = titles.getTitleCode();
        }I just get a 'nullpointerexception' when I try to run this in the main class.
    Any help or advice appreciated!

  • How to Access Protected Method of a Class

    Hi,
         I need to access a Protected method (ADOPT_LAYOUT) of class CL_REIS_VIEW_DEFAULT.
    If i try to call that method by using class Instance it is giving error as no access to protected class. Is there any other way to access it..

    Hi,
        You can create a sub-class of this class CL_REIS_VIEW_DEFAULT, add a new method which is in public section and call the method ADOPT_LAYOUT of the super-class in the new method. Now you can create an instance of the sub-class and call the new sub-class method.
    REPORT  ZCD_TEST.
    class sub_class definition inheriting from CL_REIS_VIEW_DEFAULT.
    public section.
      methods: meth1 changing cs_layout type LVC_S_LAYO.
    endclass.
    class sub_class implementation.
    method meth1.
      call method ADOPT_LAYOUT changing CS_LAYOUT = cs_layout.
    endmethod.
    endclass.
    data: cref type ref to sub_class.
    data: v_layout type LVC_S_LAYO.
    start-of-selection.
    create object cref.
    call method cref->meth1 changing cs_layout = v_layout.

  • Changing exception clause in method signature when overwriting a method

    Hi,
    I stumbled upon a situation by accident and am not really clear on the details surrounding it. A short description:
    Say there is some API with interfaces Foo and Bar as follows:
    public interface Foo {
       void test() throws Exception;
    public interface Bar extends Foo {
       void test();
    }Now, I find it strange that method test() for interface Bar does not need to define Exception in its throws clause. When I first started with Java I was using Java 1.4.2; I now use Java 1.6. I cannot remember ever reading about this before and I have been unable to find an explanation or tutorial on how (or why) this works.
    Consider a more practical example:
    Say there is an API that uses RMI and defines interfaces as follwows:
    public interface RemoteHelper extends Remote {
       public Object select(int uid) throws RemoteException;
    public interface LocalHelper extends RemoteHelper {
       public Object select(int uid);
    }As per the RMI spec every method defined in a Remote interface must define RemoteException in its throws clause. The LocalHelper cannot be exported remotely (this will fail at runtime due to select() in LocalHelper not having RemoteException in its clause if I remember correctly).
    However, an implementing class for LocalHelper could represent a wrapper class for RemoteHelper, like this:
    public class Helper implements LocalHelper {
       private final RemoteHelper helper;
       public Helper(RemoteHelper helper) {
          this.helper = helper;
       public Object select(int id) {
          try {
             return (this.helper.select(id));
          } catch(RemoteException e) {
             // invoke app failure mechanism
    }This can uncouple an app from RMI dependancy. In more practical words: consider a webapp that contains two Servlets: a "startup" servlet and an "invocation" servlet. The startup servlet does nothing (always returns Method Not Allowed, default behaviour of HttpServlet), except locate an RMI Registry upon startup and look up some object bound to it. It can then make this object accessible to other classes through whatever means (i.e. a singleton Engine class).
    The invocation servlet does nothing upon startup, but simply calls some method on the previously acquired remote object. However, the invocation servlet does not need to know that the object is remote. Therefore, if the startup servlet wraps the remote object in another object (using the idea described before) then the invocation servlet is effectively removed from the RMI dependancy. The wrapper class can invoke some sort of failure mechanism upon the singleton engine (i.e. removing the remote object from memory) and optionally throw some other (optionally checked) exception (i.e. IllegalStateException) to the invocation servlet.
    In this way, the invocation servlet is not bound to RMI, there can be a single point where RemoteExceptions are handled and an unchecked exception (i.e. IllegalStateException) can be handled by the Servlet API through an exception error page, displaying a "Service Unavailable" message.
    Sorry for all this extensive text; I just typed out some thoughts. In short, my question is how and why can the throws clause change when overwriting a method? It's nothing I need though, except for the clarity (e.g. is this a bad practice to do?) and was more of an observation than a question.
    PS: Unless I'm mistaken, this is basically called the "Adapter" or "Bridge" (not sure which one it is) pattern (or a close adaptation to it) right (where one class is written to provide access to another class where the method signature is different)?
    Thanks for reading,
    Yuthura

    Yuthura wrote:
    I know it may throw any checked exception, but I'm pretty certain that an interface that extends java.rmi.Remote must include at least java.rmi.RemoteException in its throws clause (unless the spec has changed in Java 1.5/1.6).No.
    A method can always throw fewer exceptions than the one it's overriding. RMI has nothing to do with it.
    See Deitel & Deilte Advanced Java 2 Platform How To Program, 1st Ed. (ISBN 0-13-089650-1), page 793 (sorry, I couldn't find the RMI spec quick enough). Quote: "Each method in a Remote interface must have a throws clause that indicates that the method can throw RemoteException".Which means that there's always a possibility of RemoteException being thrown. That's a different issue. It's not becusae the parent class can throw RE. Rather, it's because some step that will always be followed is declared to throw RE.
    I later also noticed I could not add other checked exceptions, which made sense indeed. Your explanation made perfect sense now that I heard (read) it. But just to humour my curousity, has this always been possible? Yes, Java has always worked that way.
    PS: The overwriting/-riding was a grammatical typo (English is not my native language), but I meant to say what you said.No problem. Minor detail. It's a common mistake, but I always try to encourage proper terminology.

  • Can't use inherited method with JButton

    I am trying to use the getActionListeners() method on a JButton. The method is inherited from the AbstractButton class. However, when I try to compile with this line...
    ActionListener CurrentListeners[] = OKButton.getActionListeners();I get the following error:
    Method getActionListeners() not found in class javax.swing.JButton.
    I am also using the removeActionListener() method, which is inherited from the same object, and the compiler has no problem with that!

    Okay, then does anyone know how I can change the
    ActionListener for a JButton? I want to use the
    removeActionListener(ActionListener l) method and then
    addActionListener(...). However, since I can't get
    the current ActionListener, I have nothing to pass
    into the remove method.It's my belief that's this is why this method was added to AbstractButton in JDK 1.4. It makes life so much easier. Why don't you download the JDK 1.4 and install it into your IDE?
    Otherwise, you should subclass JButton as someone else suggested and provide an accessor method for the listener.

  • BUG? @Transactional doesn't work on inherited methods

    Hi all,
    I have to state an odd behaviour:
    I have a DAO interface :
    public interface UserDAO
    ..public User save(User user);
    In my application I have to use this UserDAO interface to rebuild the DAO layer with a Toplink database access. The new UserDAO implementation is injected into the original ServiceLayer. The according UserService looks like :
    public interface UserService
    ..public User save(User user);
    And the implementation :
    public class UserServiceImpl
    ..protected UserDAO userDAO;
    ..public User save(User user)
    ....userDAO.save(user);
    ..public setUserDAO(UserDAO userDAO)
    ....this.userDAO = userDAO;
    However, until I can save my user objects with Toplink I have to annotade the UserService as transactional. Therefore I would write a new UserService class, exending from the original one, like this :
    import org.springframework.transaction.annotation.Transactional;
    @Transactional
    public class TransactionalUserService extends UserServiceImpl
    And thats all, since I can inject my JPA UserDAO into this TransactionalUserService and everything will work right.
    --> BUT NO ! In this case nothing happens transactional. It only works, when I rewrite the UserService. Then I have :
    @Transactional
    public class TransactionalUserService implements UserService
    ..private UserDAO userDAO;
    ..public User save(User user)
    ....userDAO.save(user);
    ..public setUserDAO(UserDAO userDAO)
    ....this.userDAO = userDAO;
    Now my user objects are stored into the database. But why only in this case and not with inherited methods ?

    Spring is the one managing your transactions and @Transactional is a Spring annotation so you might get a quick answer to your question on the Spring Data Access Forum.
    That being said, instead of subclassing UserServiceImpl just to add @Transactional you could instead use <tx:advice> in your Spring XML configuration to make UserServiceImpl transactional.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Using inherited methods (Quick Question)

    If I have a subclass that extends a parent class, do I have to use the methods that are inherited from the parent class or can they be ignored? For example, I inherit getArea and getVolume, but I am only interested in using getArea in my subclass, can I just ignore getVolume and not do anything with it? Or is there something I have to do to block its use? Also, does the same go for the attributes that are inherited via the constructor when autogenerate the inherited constructor? Thanks!

    NPP83 wrote:
    If I have a subclass that extends a parent class, do I have to use the methods that are inherited from the parent class or can they be ignored? For example, I inherit getArea and getVolume, but I am only interested in using getArea in my subclass, can I just ignore getVolume and not do anything with it?I think the more pertinent question is: are they correct? You might be able to subclass a cube with a square (they both only require a side length), but the getVolume method would be patently incorrect for a square.
    Or is there something I have to do to block its use?UnsupportedOperationException is the most normal.
    Also, does the same go for the attributes that are inherited via the constructor when autogenerate the inherited constructor?Erm....???? If you mean, do you inherit attributes, the answer is: yes(***), unless they're private.
    Winston
    (***) Actually 'maybe', if they're default-visibility.

  • Inheritance problem with parent class calling child class

    I have a problem with inheritance with a parent class calling a child class method. Below is the example pseudocode code and my problem:
    public abstract class A {
        protected void function1 ( ) { }
        protected void function2 () {
             //calls function1();
             function1();
    public abstract class B extends A {
        protected void function1 ()  {
             // do stuff
    public class C extends B {
        protected void function1 ()  {
            // do stuff
            super.function1 ();
    }I have an object instance of class C created and its function2() is invoked.
    My problem is, while in function2(), which belongs to abstract class A and the method call to function 1() is called, the call invokes the function1() of class B. Shouldn't the call invoke function 1() of class C instead? And then function1() of class B will be called after due to the super.function1(). It's not behaving like I thought it would.
    Edited by: crono77 on Jan 10, 2008 8:13 PM

    Nevermind, i found my error :)

  • "Blocking" inherited  methods

    I have a class, Inventory which I want to extend HashMap. However, I only want objects of certain types added to it, and in a certain way.
    To do this, I envisaged having public methods like :
    public Object put(MyType1 key, MyType2 value)...but then I want to prevent the use of the standard put method of the HashMap (ie. to "enforce" the above method). I attempted this by overriding it and declaring it private, but that isn't allowed by Java. Is there a way I can extend the class and not allow inherited methods to be used?
    I can see two (less than satisfactory) ways around this :
    1) Override the methods, but implement no functionality for general arguments. This has the drawback of not being picked up as an error if the method is used.
    2) Make the HashMap an instance variable. But that would involve a lot more rewriting of other code, and re-implementing methods I want to inherit.
    (There are a other methods I want to override, not just put, btw).

    2) Make the HashMap an instance variable. But that
    would involve a lot more rewriting of other code,
    and re-implementing methods I want to inherit.It shouldn't require much rewriting for existing client code as you could put helper methods into your new class. E.G.
    public int size()
      return myHashMap.size();
    }Theres only a few methods in HashMap so it wouldn't take too long to do. This also has the advantage that you are now able to have your own typesafe methods. E.G.
    public MyType2 put(MyType1 key, MyType2 value)
      return (MyType2)myHashMap.put(key, value);
    }Col

Maybe you are looking for

  • Using MPB with lid closed?

    I'd like to use my MBP 13" for iTunes that powers my remote speakers and airTunes etc. Thing is, I'd like to be able to close the lid and leave it going (my charger is in my AV cabinet which the MBP only fits in when closed), whereas currently whenev

  • Flash player not working in IE 10

    Using IE 10 with Windows 7 sp1.  Flash videos on ALL websites do not play, I get the prompt to click here to install flash player.  I have installed newest flash version countless times.  The add-on Shockwave Flash Player is enabled.  Flash movies pl

  • A J2SE 1.4 Question  :  Someboby please help.

    Hello, I have a question about The new class NetworkInterface.java in the net package. I am a freshman in computer science and a newly sun certified programmer. I am writing a class to retrieve a Network' s public (ip)address from the inside (from a

  • Can I import my favorites from Lunascape?

    Before I switched to Firefox, I was using Lunascape. I am wondering if there is any way for me to import my favorites list from there to Firefox. I was able to import my favorites from Internet Explorer, however, I'd also like to transfer my favorite

  • Error 20544 Access Denied with Crystal ActiveX control in VB6

    Post Author: beckybear CA Forum: General We have a piece of legacy software written a while ago that is in VB6 using the Crystal ActiveX control crystl32.ocx.  We use 8.5 of Crystal Reports.About 50 or so users have this program loaded and it runs a