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

Read ABAP codes from a function module

former_member367551
Participant
0 Likes
5,536

Dear forumers,

How may I read ABAP codes from a function module (source codes: function module)?

I have tried the command READ REPORT for report programs, but this obviously does not work for function modules.

Does anyone have any idea on this at all?

Thanks.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
3,352

Alternative way

- First find the include name - read TFDIR to get Function group main program and include number

- Generate include name via FUNCTION_INCLUDE_CONCATENATE

- READ REPORT on this include

Regards,

Raymond

7 REPLIES 7
Read only

Former Member
0 Likes
3,352

Hello

Use FM 'RPY_FUNCTIONMODULE_READ' for this.

Read only

3,352

This FM will only work for FM that do not have a line of code longer than 72 characters. raymond.giuseppi's solution is therefore preferable.

Read only

MarcinPciak
Active Contributor
0 Likes
3,352

Alternatively you can extract it from table REPOSRC

- check FG for that FM (in SE37 -> Goto -> Functionm Groups -> Display Group )

- write select query checking REPOSCR-PROGANAME with SAPLNAMEOFFUNCTIONGROUP

- extract content of field REPOSCR-DATA wich is of type RAWSTRING

Regards

Marcin

Read only

Former Member
0 Likes
3,352

Hi,

Table REPOSRC stores the ABAp code for a program in a compressed(RAW) form. U can use FMs like RPY_PROGRAM_READ or RPY_PROGRAM* to read that data.

Regards,

Mrunal

Read only

RaymondGiuseppi
Active Contributor
3,353

Alternative way

- First find the include name - read TFDIR to get Function group main program and include number

- Generate include name via FUNCTION_INCLUDE_CONCATENATE

- READ REPORT on this include

Regards,

Raymond

Read only

0 Likes
3,352

RPY_FUNCTIONMODULE_READ

this will gove you the source code, import, export, table parameter and the documentation as well in different table paramteres of that FM.

but if you have includes for that FM, like top includes where you have coded, then you need to use the FM:

FUNCTION_INCLUDE_CONCATENATE to read the include names and use read report on those includes.

you can also use RPY_PROGRAM_READ to read those

Read only

0 Likes
3,352

Hi everyone,

Thanks for all the inputs and ideas here. Appreciate it a lot.

This has been resolved easily by using the FM, FUNCTION_INCLUDE_CONCATENATE.

Thanks again!