How to get the name of the class which is currently in use
I have two classes Mother and Child, and I use this code to print the name of the class in use
DATA m TYPE REF TO zmother.
DATA class_name type string VALUE 'CHILD'.
CREATE OBJECT m TYPE (class_name).
CALL METHOD m->PrintName .
So, what is the source code that I have to put in the PrintName methode?
Alejandro Bindi replied
You can use the SYSTEM_CALLSTACK function module.
Read this thread, Uwe has given details on both getting the calling class and method: How to determine current method / interface method that is running?
Most probably this solves your needs.