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

Access Source Code of programs / functions

Former Member
0 Likes
1,259

Hello,

Is it possible to access (read only of course) the Source-Code of class-methods / function modules & abap programs in ABAP?

Example:

Function Module yy_test:


FUNCTION yy_test.

data yy_test_boolean type xfeld.

yy_test_boolean = 'X'.

ENDFUNCTION.

Webdynpro method:


Data lv_result type string.
CALL FUNCTION 'READ_FUNCTION_SOURCE'
EXPORTING iv_name = 'YY_TEST'
IMPORITNG ev_source = lv_result.

==> lv_result = 'function yy_testndata yy_test_boolean type xfeld. \n\nyy_test_boolean = 'X'.\nendfunction'.

Thank you very much,

Timo Stark

4 REPLIES 4
Read only

Former Member
0 Likes
741

Hi ,

To access source code of class methods , go to transaction se24 ,

Give the class name , you will get all methods , attributes etc .

Double click on the method to read the code.(Its only read only though).

Thanks,

Aditya.

Read only

0 Likes
741

Yeah.. I really meant a dynamic way.

E.g. imagine a situation in which i want to present the user the source of a class in a web-dynpro dynamically (==> the user can determine the name of the class).

Or another situation: I want to analyse the source-code of classes dynamically for common faults and programming mistakes.

Read only

thomas_jung
Developer Advocate
Developer Advocate
0 Likes
741

This isn't really a web dynpro ABAP directly related question. You might want to use the source in a WD application, but actually retrieving the source code is not WD specific. I am going to move this question to ABAP General, but you should also search that forum or look at the source of the SAPlink project (or perform a trace during editing in SE80). There are internal APIs used within the workbench for accessing the class method's source code for example.

>>>Moderator note: moved thread from Web Dynpro ABAP forum to ABAP General

Edited by: Thomas Jung on Sep 20, 2010 8:18 AM

Read only

Former Member
0 Likes
741

there are several FM´s that can read sources e.G. RV_READ_REPORT.

reports are stored in table REPOSRC. hope this will get you a bit further.