<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Read function module source code into an internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844792#M44963</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here we go ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 DATA : GV_PROG_NAME    TYPE TRDIR-name.
 
  SELECT SINGLE *
    FROM   TFDIR
    WHERE  funcname = P_PROGF.
    IF SY-subrc EQ 0.
      CONCATENATE TFDIR-pname 'U' tfdir-include INTO GV_PROG_NAME.
      GV_PROG_NAME = gv_prog_name+3(30).
      
    ELSE.
      MESSAGE e001(AQ) WITH
    'Function module does not exit'.
    ENDIF.

* read the report code lines in an internal table
  READ REPORT GV_PROG_NAME INTO GT_REP_TABLE.
  IF SY-subrc &amp;lt; &amp;gt;  0.
    MESSAGE e001(AQ) WITH
           'Code is blank'.
    EXIT.
  ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should be enough or else check this link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.geocities.com/rmtiwari/Resources/Utilities/WebViewer.html" target="test_blank"&gt;http://www.geocities.com/rmtiwari/Resources/Utilities/WebViewer.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Ram Manohar Tiwari&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 25 Jun 2005 06:35:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-06-25T06:35:32Z</dc:date>
    <item>
      <title>Read function module source code into an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844786#M44957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;P&gt;       My requirement is to search a string in a function module source code. Is there any statment to read the source of the function module into a internal table . i kown one statement which read the report source code (read report 'z_..' into itab, similarly is there any stmt. / standard SAP program which do the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;vijay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2005 17:41:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844786#M44957</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-08T17:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Read function module source code into an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844787#M44958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using RPR_ABAP_SOURCE_SCAN.  This will allow you to search many different ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2005 17:46:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844787#M44958</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-03-08T17:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Read function module source code into an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844788#M44959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi mani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every function module is a program by itself. So if a function module belongs to function group XYZ, then the main program name will be SAPLXYZ and the function module's source code program will be in the form of LXYZUnnn(where nnn is a sequential number). You can get this information from the attributes tab of the function  module in SE37.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use 'READ REPORT' to read the code of the function module. But if you are looking for all the subroutines that are written in includes of the main program, then you need to code for reading it. There is not standard way to get it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a logical flow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Get the main program of the function module and the include name for the function module.&lt;/P&gt;&lt;P&gt;2. Read report 'main program'. on each line search for the pattern 'LXYZU' and read that include name. For each include you can do a 'read report'. That way you will get the source code of the complete function group, not just the function module. But if it is just the function module code, you are interested in, then simply do a 'read report &amp;lt;function module include name here&amp;gt;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Srinivas Adavi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, you can also use the function module 'SCWB_GET_ABAP_CODE_OF_OBJECT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2005 17:59:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844788#M44959</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-08T17:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Read function module source code into an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844789#M44960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could write your own function module to retrieve the source code of the program and all of the includes of a program.  Just convert this sample program to a function module.  You will need to do some coding to retrieve the includes of the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001
       no standard page heading
       line-size 300.

parameters: p_prog(60) type c.

data: begin of s occurs 0,
      txt(300) type c,
      end of s.

read report p_prog into s.         
loop at s.
  write:/ s-txt.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2005 18:01:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844789#M44960</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-03-08T18:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Read function module source code into an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844790#M44961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi vijay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;look here:&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="151390"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards Andreas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Mar 2005 07:22:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844790#M44961</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2005-03-09T07:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Read function module source code into an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844791#M44962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi srinivas can u give me the right syntax for reading a function module code in internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can mail me on azeeash79@yahoo.com&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;azee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2005 10:57:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844791#M44962</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-24T10:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Read function module source code into an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844792#M44963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here we go ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 DATA : GV_PROG_NAME    TYPE TRDIR-name.
 
  SELECT SINGLE *
    FROM   TFDIR
    WHERE  funcname = P_PROGF.
    IF SY-subrc EQ 0.
      CONCATENATE TFDIR-pname 'U' tfdir-include INTO GV_PROG_NAME.
      GV_PROG_NAME = gv_prog_name+3(30).
      
    ELSE.
      MESSAGE e001(AQ) WITH
    'Function module does not exit'.
    ENDIF.

* read the report code lines in an internal table
  READ REPORT GV_PROG_NAME INTO GT_REP_TABLE.
  IF SY-subrc &amp;lt; &amp;gt;  0.
    MESSAGE e001(AQ) WITH
           'Code is blank'.
    EXIT.
  ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should be enough or else check this link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.geocities.com/rmtiwari/Resources/Utilities/WebViewer.html" target="test_blank"&gt;http://www.geocities.com/rmtiwari/Resources/Utilities/WebViewer.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Ram Manohar Tiwari&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jun 2005 06:35:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844792#M44963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-25T06:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: Read function module source code into an internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844793#M44964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     You can use the standard SAP Program RKCTSEAR for searching strings contained in the source code of any program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;K Vijayasekar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jun 2005 13:08:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-function-module-source-code-into-an-internal-table/m-p/844793#M44964</guid>
      <dc:creator>VijayasekarK</dc:creator>
      <dc:date>2005-06-25T13:08:14Z</dc:date>
    </item>
  </channel>
</rss>

