Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Can we chagne Super class method parameters in Sub class

Former Member
0 Likes
505

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

3 REPLIES 3
Read only

uwe_schieferstein
Active Contributor
0 Likes
469

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

Read only

Former Member
0 Likes
469

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

Read only

narin_nandivada3
Active Contributor
0 Likes
469

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