Skip to Content
author's profile photo Former Member
Former Member

Read Functions

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 10, 2005 at 04:43 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 10, 2005 at 04:25 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 10, 2005 at 04:25 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.