cancel
Showing results for 
Search instead for 
Did you mean: 

Read Functions

Former Member
0 Kudos

I know that the function modules are kept in TFDIR but where is the code of that functions?

Can anyone tell me the name of the table?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

ABAP source can be found in table REPOSRC but I would recommend the READ REPORT... statement instead of reading the source directly.

Function groups create ABAP source with name SAPLmy_group where my_group is your function group name. Then includes get created with name Lmy_group... with various suffixes.

Answers (2)

Answers (2)

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

I don't think that ABAP source is "really" stored in a table. Here is a program which gives an example of how to read the source code, whereever it may be stored.



REPORT ZRICH_0001
       NO STANDARD PAGE HEADING
       LINE-SIZE 300.

TABLES: TRDIR.

DATA: I_TRDIR LIKE TRDIR OCCURS 0 WITH HEADER LINE.


DATA: BEGIN OF S OCCURS 0,
      TXT(300) TYPE C,
      END OF S.

SELECT * INTO CORRESPONDING FIELDS OF TABLE I_TRDIR
            FROM TRDIR
                 WHERE NAME LIKE 'Z%'
                    OR NAME LIKE 'SAPMZ%'
                    OR NAME LIKE 'LZ%'
                    OR NAME LIKE 'MZ%'.


LOOP AT I_TRDIR.

  CLEAR S. REFRESH S.
  READ REPORT I_TRDIR-NAME INTO S.           "Get source into table S

  LOOP AT S.
    WRITE:/ S-TXT.

  ENDLOOP.


ENDLOOP.

Regards,

Rich Heilman

former_member214131
Active Contributor
0 Kudos

Hello,

When a FM is created the system creates and generates a PROGRAM and the name of the program is stored in field PNAME of the Table TFDIR. You can see the code related to the specific FM will be stored in the second Include with a comment " Function Modules.

Perhaps you can get the source code by 'READ REPORT' key word.

Hope this helps you.

Regards, Murugesh AS