Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3184

Determine class name used for calling a static method

$
0
0

Hi all,

 

I know static methods cannot be redefined, but they can be called using a subclass as the 'calling class name'. Is it possible to determine the object type used for calling a static method?

 

For example, I have ZCL_SUPER with a static method HELLO and a subclass ZCL_SUB.

 

I can use ZCL_SUPER=>HELLO( ) or I can use ZCL_SUB=>HELLO( ).

 

Both will execute the same code (correct), but is it possible to tell the difference inside the HELLO method? SY-REPID will always show the superclass (also correct).

 

I've found some similar threads but none with a clear answer.

 

Any input appreciated,

Mike


Viewing all articles
Browse latest Browse all 3184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>