2009 Dec 30 8:10 AM
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.
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
2009 Dec 30 8:29 AM
Have a look at this thread
link:[Download abap class|http://www.sapnet.ru/viewtopic.php?p=7706]
2009 Dec 30 9:11 AM
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
2009 Dec 30 9:12 AM
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
2014 Mar 25 10:04 PM
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
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |