‎2010 Mar 30 3:21 PM
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?
‎2010 Mar 30 3:31 PM
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
‎2010 Mar 30 3:31 PM
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
‎2010 Mar 31 1:34 PM
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