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

Function Module or Class to write the source code of a class

Former Member
0 Likes
712

Hi all,

Does anyone know a FM or a class using which I can read the source code of the methods of the class?

Thanks,

Sükrü

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
616

Sure, something like this?



REPORT  zrich_0002.

DATA includename TYPE program.
DATA _classname TYPE seoclsname VALUE 'CL_GUI_ALV_GRID'.
DATA isource TYPE STANDARD TABLE OF string WITH HEADER LINE.

includename = cl_oo_classname_service=>get_pubsec_name( _classname ).
READ REPORT includename INTO isource.
LOOP AT isource.
  WRITE:/ isource.
ENDLOOP.

includename = cl_oo_classname_service=>get_prosec_name( _classname ).
READ REPORT includename INTO isource.
LOOP AT isource.
  WRITE:/ isource.
ENDLOOP.

includename = cl_oo_classname_service=>get_prisec_name( _classname ).
READ REPORT includename INTO isource.
LOOP AT isource.
  WRITE:/ isource.
ENDLOOP.

includename = cl_oo_classname_service=>get_ccimp_name( _classname ).
READ REPORT includename INTO isource.
LOOP AT isource.
  WRITE:/ isource.
ENDLOOP.

includename = cl_oo_classname_service=>get_ccdef_name( _classname ).
READ REPORT includename INTO isource.
LOOP AT isource.
  WRITE:/ isource.
ENDLOOP.

includename = cl_oo_classname_service=>get_ccmac_name( _classname ).
READ REPORT includename INTO isource.
LOOP AT isource.
  WRITE:/ isource.
ENDLOOP.

Regards,

RIch Heilman

Read only

former_member194669
Active Contributor
0 Likes
616

Hi,

Check this Link

Read only

lars_grabenhorst
Explorer