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

ABAP OO question

Former Member
0 Likes
589

Hi,

Can someone please explain me the concept withe the below behavior ?

System : SAPCRM 20007.

Class : CL_BT311H_C_CSROVERVIEW_IMPL

Super Class : CL_BT311H_C_CSROVERVIEW.(A)

Super class of A : CL_CRM_UIU_BT_H_OVW_VIEWSET (B)

Method Do_Handle_event is defined in the Super class.

Please look at method call EH_ONCREATE_CLOSED(line 64) in the above do_handle_event method. This method is not defined in the super class (A) but is defined in Sper class B. In this case, wouldn't we need to use keyword 'SUPER' ?

When I double click on EH_ONCREATE_CLOSED method it takes me to the Super class B. I would expect the same behavior when I debuf, i.e control must go to the definition of the method in super class B. But in debug mode EH_ONCREATE_CLOSED takes us to the definition in implementation class ( CL_BT311H_C_CSROVERVIEW_IMPL) ( There is a method with same name EH_ONCREATE_CLOSED in the impl class. Why this behavior ?

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
0 Likes
563

Not all of us have access to CRM. Can you construct or find an example that's part of a package in BC?

If you have an object defined with ref to CL_BT311H_C_CSROVERVIEW_IMPL and call a method. If that method isn't defined in the class, but is defined (protected or public) in a superclass, then the superclass method will be called. You only use SUPER when you've defined the method in the subclass, but want to run the superclass implementation.

Re:the debugger. It just works like that. I don't see what the problem is.

matt

3 REPLIES 3
Read only

matt
Active Contributor
0 Likes
564

Not all of us have access to CRM. Can you construct or find an example that's part of a package in BC?

If you have an object defined with ref to CL_BT311H_C_CSROVERVIEW_IMPL and call a method. If that method isn't defined in the class, but is defined (protected or public) in a superclass, then the superclass method will be called. You only use SUPER when you've defined the method in the subclass, but want to run the superclass implementation.

Re:the debugger. It just works like that. I don't see what the problem is.

matt

Read only

Former Member
0 Likes
563

Thanks for the answer Matt. I'm still not clear with the behavior during debug. Let me see if I can explain it more clearly here..

I have three classes: 1) IMPL CLASS 2) SUPER CLASS A (Super class of IMPL) 3) SUPER CLASS B (SUPER CLASS OF A)

1) Method : EH_ONCREATE_CLOSED called in Superclass A.

2) Super class A does not have definition for EH_ONCREATE_CLOSED method. Super class B has this method defined(protected method). When I double click on this method it takes me to the method definition in the super class.

(so far, I understand the behavior)

3) The same method EH_ONCREATE_CLOSED (again protected) is also defined in IMPL Class. I have a break point at the statement that triggers the method call in super class A and I do F5. It takes me to EH_ONCREATE_CLOSED method in IMPL Class. The question I have here is why it doesn't take me to the definition of the method in super class B ? Because that is where it takes me when I do double click on the method call.

Thanks for your time and appreciate your help.

Sreesanth

Read only

Former Member
0 Likes
563

Hi Matt,

Package BC does not have any classes in it.. I was not sure what you wanted me to check in this package. Can you please let me know what to look for here to get better understanding of the concept ?

Thanks

Sreesanth