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

Missing CLASS_CONSTRUCTOR

Former Member
0 Likes
1,668

Hi,

I've had inherited from a standard class that has CLASS_CONSTRUCTOR implemented. In my Z class I can implement CONSTRUCTOR but not CLASS_CONSTRUCTOR. If I try, it says

A Component CLASS_CONSTRUCTOR has already been inherited from CL_ISH_COMP_CORDER_USER

Any ideas?

Thanks!

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,471

Afaik, CONSTRUCTORs & CLASS_CONSTRUCTORs are not inherited.

In your inherited class is the CLASS_CONSTRUCTOR button available on the application toolbar & when you try to implement it you're getting this error message? Please clarify.

BR,

Suhas

PS: I can see you're on an IS-H environment, very few of us will have access to ISH system

6 REPLIES 6
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,472

Afaik, CONSTRUCTORs & CLASS_CONSTRUCTORs are not inherited.

In your inherited class is the CLASS_CONSTRUCTOR button available on the application toolbar & when you try to implement it you're getting this error message? Please clarify.

BR,

Suhas

PS: I can see you're on an IS-H environment, very few of us will have access to ISH system

Read only

Former Member
0 Likes
1,471

Hi Suhas,

Thanks for your comment. If I use the button to create the method it works! There is a bug in the standard that if you try to define it by right-click or manually completing the name in the methods tab then I get an error. Weird but is solved now .

Hope this will help other people too.

Regards,

Damián.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,471

Hello Damian,

CONSTRUCTOR & CLASS_CONSTRUCTOR are reserved method names & i had never tried to implement those by typing in their names directly (when working with Global classes, obviously)

BR,

Suhas

Read only

0 Likes
1,471

It's not a bug, it's intended to be this way so you have to use the buttons.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,471

Hello Custodio,

This is kind of half-true. In non-inherited classes, if you key in the method names - CONSTRUCTOR & CLASS_CONSTRUCTOR - SAP will automatically generate the relevant methods! But this is not the case with inherited classes

I expect a more consistent behavior.

BR,

Suhas

Read only

0 Likes
1,471

Thanks, new info for me. Actually, even if a class is inherited you can type CONSTRUCTOR and it will be ok, as long as the CONSTRUCTOR method is not inherited, ie superclass does not have CONSTRUCTOR.

Not sure it's clear and/or was what you meant.