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

Inconsistent Class Constructors

MichiFr
Participant
0 Likes
855

Hi,

I've built a new (exception) class ZCX_CUSTOMER_SERVICE which itself uses the interface ZIF_CUSTOMER_SERVICE. This interface has got some attributes like QMNUM or AUFNR.

The class ZCX_CUSTOMER_SERVICE defines some aliases for this interface attributes.

Additionally I've created some further exceptions classes, like ZCX_CUSTOMER_ORDER, which are subclasses from ZCX_CUSTOMER_SERVICE. The attributes from ZCX_CUSTOMER_SERVICE or better from the interface are visible.

I'm facing, however, an issue when adding new attributes to the interface:

After adding a new attribute to the interface, I'm defining an alias in ZCX_CUSTOMER_SERVICE. The class is successfully activated afterwards.

When changing one of the subclases, ZCX_CUSTOMER_ORDER for example, I'm constantly getting this error message:

Constructor for the Class Is Inconsistent - Do you want to regenerate the constructor?.

After confirming this dialog with Yes I can activate the class ZCX_CUSTOMER_ORDER w/o any problems. What's annoying is the fact that there are plenty of subclasses out there which I've to check and change one after another.

Is there any report which does this job for me?

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
657

You may want to look at [Refactoring Assistant|http://help.sap.com/saphelp_nw04/helpdata/en/6a/42d41b192311d5969b00a0c94260a5/content.htm] and [Refactoring ABAP classes|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2513] [original link is broken] [original link is broken] [original link is broken];. This may be helpful.

Regards

Marcin

2 REPLIES 2
Read only

MarcinPciak
Active Contributor
0 Likes
658

You may want to look at [Refactoring Assistant|http://help.sap.com/saphelp_nw04/helpdata/en/6a/42d41b192311d5969b00a0c94260a5/content.htm] and [Refactoring ABAP classes|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2513] [original link is broken] [original link is broken] [original link is broken];. This may be helpful.

Regards

Marcin

Read only

0 Likes
657

Thanks Marcin for your reply.

I've checked this suggestion but unfortunately the refactoring process does not reflect its changes into subclasses. This means that subclasses still have inconsistence constructors.

I've now written a simple program which does this job:

Reading the superclass and its subclasses using cl_oo_class->get_subclasses( ). Looping over the returned classes and call function module SEO_CLIF_SAVE_ALL for each - with commit.

That's all!

Edit: It seems that SE24->Utilities->Clean Up->Constructor->Subordinate classes would do the same job. Did not notice this menu item before.

Edited by: Michael Fritz on Mar 31, 2010 2:36 PM