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.
Showing results for 
Search instead for 
Did you mean: 

class.GetName or .InstanceOf(className) in ABAP

Former Member
0 Kudos

Dear all,

how do you realize the java methods/checks

class.GetName or


of a current class instance in ABAP OO ?

best regards,

Christoph Aschauer


Active Contributor
0 Kudos

Hi Christoph

Will it be useful to use <b>RTTI (Run-Time Type Identification)</b>? That is, the class <b>"CL_ABAP_TYPEDESCR"</b> and its subclasses. One of its subclasses (<b>cl_abap_classdescr</b> as I remember) can be used to identify the type of an instantiated object.


*--Serdar <a href="">[ BC ]</a>

Developer Advocate
Developer Advocate

Here is a little code sample where an ABAP Object gets its own class name:

  data: class_desc type ref to cl_abap_typedescr.
  class_desc = cl_abap_classdescr=>describe_by_object_ref( me ).
  data: class_name type string.
  class_name = class_desc->get_relative_name( ).