Application Development 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: 

subclass instance not created during runtime

former_member305388
Active Contributor
0 Kudos

Hi Experts,

For an existing standard class a subclass was created and during runtime the me object reference points to the subclass name there by allowing the subclass additional/custom methods to be triggered.

We have done service pack upgrade in the system and during runtime I find the subclass does not exist in the me object reference due to which the custom code in the subclass is not being called.

How do I fix the above issue so that and subclass instance is created by the superclass during runtime?

4 REPLIES 4

former_member305388
Active Contributor
0 Kudos

Ok I guess I need to rephrase the question..

I have a standard class say SAP_Class and a subclass of this class say Z_Class. Now during run time in statements like me->call_some_method() how is the subclass method invoked? In debug I can find the me is pointing Z_class.

After the Service pack upgrade I can find the same call me->call_some_method() points to SAP_Class instead of Z_class. How to fix this?

Moderator Message: Duplicate post deleted. Please continue with this post

Edited by: Suhas Saha on Sep 15, 2011 4:48 PM

0 Kudos

> After the Service pack upgrade I can find the same call me->call_some_method() points to SAP_Class instead of Z_class. How to fix this?

Hello Srinivas,

As you might be knowing me is the self-reference variable which contains the reference to the instance of the class in which it is accessed. So my question to you is : Where did you check the method call; in the subclass or the superclass?

If possible, post the code snippet for better responses.

BR,

Suhas

0 Kudos

Hi Suhas,

I had put a breakpoint to debug in the subclass which was being invoked.

In the new system where the service pack has been applied I have put breakpoint in the same method but the subclass method is not being called. So the issue is the subclass instance is not created. But how do you set the subclass instance to be created during runtime? Do i need to do any changes or if the subclass inherits superclass the instance will be created automatically?

0 Kudos

Hello Srinivas,

I had put a breakpoint to debug in the subclass which was being invoked.

In the new system where the service pack has been applied I have put breakpoint in the same method but the subclass method is not being called.

The superclass method is being called. I'm sure after facing this problem(and solving it, of course) you'll have a better understanding of the 'polymorphic' behaviour of objects

if the subclass inherits superclass the instance will be created automatically?

NO!!!

You must understand none of us has a crystal ball where we can gaze & find out the solution. If you want valuable responses please provide as much info as possible.

BR,

Suhas