Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to read the source code of class method

Former Member
0 Likes
8,581

Hi,

I want to read the source code of a method which is in a BAdi implementation.

I used SEO_METHOD_GET_SOURCE function module where I passed interface name as class and method name.

But I didn't get the source code. Is there any other function module of method to read the source code.

Thanks and regards,

Venkat.

4 REPLIES 4
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
3,388

Have a look at this thread

link:[Download abap class|http://www.sapnet.ru/viewtopic.php?p=7706]

Read only

former_member217544
Active Contributor
0 Likes
3,388

Hi Venkat,

You can still use the Function Module SEO_METHOD_GET_SOURCE with a small change in the parameter passing. It should be:

Paramaters:

MTDKEY-CLSNAME : <Implementaion Classname>

MTDKEY-CPDNAME: <Interfacename~methodname>

STATE : 'A' for active or 'I' for inactive

For example:

MTDKEY-CLSNAME :ZCL_IM_PLM_AUDIT_ALV_GRID

MTDKEY-CPDNAME: IF_EX_PLM_AUDIT_ALV_GRID~ON_USER_COMMAND

STATE: A

After executing you will get the source code in the form of string in the 'SOURCE' parameter.

Hope this helps you.

Regards,

Swarna Munukoti

Read only

Clemenss
Active Contributor
0 Likes
3,388

Hi Venkat,

code derived from online docu of obsolete function module SEO_CLASS_GET_METHOD_INCLUDES:


DATA:
  OREF        TYPE REF TO IF_OO_CLASS_INCL_NAMING,
  MTDS_W_INCL TYPE SEOP_METHODS_W_INCLUDE.
FIELD-SYMBOLS:
  <MWI>       TYPE LINE OF SEOP_METHODS_W_INCLUDE.

OREF ?= CL_OO_INCLUDE_NAMING=>GET_INSTANCE_BY_CIFKEY( CLSKEY ).
MTDS_W_INCL = OREF->GET_ALL_METHOD_INCLUDES( ).

LOOP AT MTDS_W_INCL
  ASSIGNING <MWI>.

ENDLOOP.

Regards,

Clemens

Read only

0 Likes
3,388

An easy way to get all of the code from an SAP class into one screen for simple cut and past or download is to:

1) retrieve the class in transaction SE24

2) click on the Source Code-Based button

 

The code will now appear in the ABAP editor including all types, attributes and methods.

-Ken

SAP CLASS CODE DOWNLOAD