Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to get the name of the class which is currently in use

Hi all,

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?

Thanks.

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.

Regards

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question