tags:

views:

94

answers:

2

How do you actually find the class for a specific method in ABAP? Is this even possible?

EDITED: I was given a method name without the class name from the functional team, so I am wondering if we could find the class with the given method name.

A: 

Basically a method call looks like this:

object_reference->method().

If you look elsewhere in the code, object_reference should have a definition like this:

data: object_reference type ref to class.

If you double click on 'class' it will take you to transaction SE24, where you can see the class definition.

I'm leaving out a lot here (static methods, local classes, old-style method calls) but it's as much as I can do without more in your original question.

Bryan Cain
+3  A: 

I'm not sure what you mean by "finding the class for a specific method in ABAP".

  • If you want to find out which class implements a certain method of an interface at design time, use the SE80 to find the implementing classes of the interface. If that doesn't suit your needs, take a look at the view VSEOMETHOD and filter by REFINTNAME (referred interface name) and REFCMPNAME (method name)
  • If you want to find all classes that implement a method named FOO at design time, you can also use VSEOMETHOD.
  • If you want to find out which class you're calling into at runtime, use the debugger :-)
  • If you need to do this programatically, there's probably something wrong with your program structure. Still it's possible using RTTI - take a look at CL_ABAP_TYPEDESCR and its descendants.
vwegert