2009 Oct 08 4:03 AM
Dear experts,
Is there a way for me to read ABAP codes from a class method?
I understand that the methods can be found from the database table SEOCOMPO where CMPTYPE = 1. But I'm still unable to find a way to read the ABAP source codes of these methods (tried searching for the necessary FMs to accomplish this, but I can't get any too).
Please help, if there are any ideas at all.
Thanks a lot.
2009 Oct 08 10:09 AM
Hi Deborah,
You should have a look to MF SEO_METHOD_GET_SOURCE.
You have to fill MTDKEY with class name / method name and STATE with the state of activation of your method (in most of cases, you will have to put 'A' : activated)...
DATA : ls_mtdkey TYPE seocpdkey,
lt_source TYPE TABLE OF edpline,
lt_source_exp TYPE rswsourcet,
ld_incname TYPE program.
ls_mtdkey-clsname = 'CL_ABAP_STRUCTDESCR'.
ls_mtdkey-cpdname = 'CREATE'.
CALL FUNCTION 'SEO_METHOD_GET_SOURCE'
EXPORTING
mtdkey = ls_mtdkey
state = 'A'
IMPORTING
SOURCE = lt_source
source_expanded = lt_source_exp
incname = ld_incname
EXCEPTIONS
OTHERS = 1.Best regards,
Samuel
Samuel, thanks a lot for the help. This works perfectly!
2009 Oct 08 10:09 AM
Hi Deborah,
You should have a look to MF SEO_METHOD_GET_SOURCE.
You have to fill MTDKEY with class name / method name and STATE with the state of activation of your method (in most of cases, you will have to put 'A' : activated)...
DATA : ls_mtdkey TYPE seocpdkey,
lt_source TYPE TABLE OF edpline,
lt_source_exp TYPE rswsourcet,
ld_incname TYPE program.
ls_mtdkey-clsname = 'CL_ABAP_STRUCTDESCR'.
ls_mtdkey-cpdname = 'CREATE'.
CALL FUNCTION 'SEO_METHOD_GET_SOURCE'
EXPORTING
mtdkey = ls_mtdkey
state = 'A'
IMPORTING
SOURCE = lt_source
source_expanded = lt_source_exp
incname = ld_incname
EXCEPTIONS
OTHERS = 1.Best regards,
Samuel
2009 Oct 20 9:44 AM
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |