‎2009 Oct 01 10:02 AM
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.
‎2009 Oct 01 10:52 AM
‎2009 Oct 01 10:08 AM
‎2021 Jan 30 12:51 AM
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.
‎2009 Oct 01 10:11 AM
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
‎2009 Oct 01 10:12 AM
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
‎2009 Oct 01 10:52 AM
‎2009 Oct 01 11:02 AM
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
‎2009 Oct 07 8:56 AM
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!