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

Can we chagne Super class method parameters in Sub class

Hi,

I created a super class. In that class i created a method. That method is having 4 input parameters and 4 export parameters.

I created a sub class for that super class. I need to use only 2 input parameters in this class rather than 4 parameters. I want to delete 2 Input parameters in the sub class of the super class method. Is it possible.

If possible. can we give an simple code or pseudo code?

regards,

krishna

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Sep 23, 2008 at 06:35 AM

    Hello Krishna

    You may define the two IMPORTING parameters which are not required for the sub-class as optional in the super-class method.

    Regards

    Uwe

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2008 at 06:50 AM

    Hi,

    I think you can not.

    Because, only public attributes can be inherited and they will remain public in the subclass.

    for further detail check,

    http://help.sap.com/saphelp_nw70/helpdata/en/1d/df5f57127111d3b9390000e8353423/content.htm

    regards,

    Anirban

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 23, 2008 at 08:10 AM

    Hi Krishna,

    Its not possible to delete the method parameters in the subclass of superclass method. Rather you can set the unnecessary importing parameters as OPTIONAL.

    Hope this would solve your issue.

    Good luck

    Narin

    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.