<?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 How can I get the function name from within a function? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-get-the-function-name-from-within-a-function/m-p/1460191#M217285</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;I would like to dynamically get the name of the function module within which my INCLUDED code is sitting - i.e. I do not want the includes name or the calling programs name, but the function name within which the include is sitting...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just like SY-CPROG returns the ABAP program name within which the function is being called, I wish to know what the actual functions name is? Is this possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Jul 2006 10:26:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-20T10:26:09Z</dc:date>
    <item>
      <title>How can I get the function name from within a function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-get-the-function-name-from-within-a-function/m-p/1460191#M217285</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;I would like to dynamically get the name of the function module within which my INCLUDED code is sitting - i.e. I do not want the includes name or the calling programs name, but the function name within which the include is sitting...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just like SY-CPROG returns the ABAP program name within which the function is being called, I wish to know what the actual functions name is? Is this possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2006 10:26:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-get-the-function-name-from-within-a-function/m-p/1460191#M217285</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-20T10:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the function name from within a function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-get-the-function-name-from-within-a-function/m-p/1460192#M217286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi nk,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. use the FM SYSTEM_CALLSTACK&lt;/P&gt;&lt;P&gt;  (inside the FM code)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. It will return an internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. just read the first row (index 1)&lt;/P&gt;&lt;P&gt;  and u will get the current FM (which is being called)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2006 10:31:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-get-the-function-name-from-within-a-function/m-p/1460192#M217286</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-20T10:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the function name from within a function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-get-the-function-name-from-within-a-function/m-p/1460193#M217287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do that using &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SYSTEM_CALLSTACK'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR, JAcek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2006 10:34:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-get-the-function-name-from-within-a-function/m-p/1460193#M217287</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-20T10:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the function name from within a function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-get-the-function-name-from-within-a-function/m-p/1460194#M217288</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;call the FM &amp;lt;b&amp;gt;SYSTEM_CALLSTACK&amp;lt;/b&amp;gt;, this will give you the stack table here you can see all the calls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2006 10:38:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-get-the-function-name-from-within-a-function/m-p/1460194#M217288</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-20T10:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the function name from within a function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-get-the-function-name-from-within-a-function/m-p/1460195#M217289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellent! Thanks guys! Will reward points...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2006 10:47:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-get-the-function-name-from-within-a-function/m-p/1460195#M217289</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-20T10:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the function name from within a function?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-get-the-function-name-from-within-a-function/m-p/1460196#M217290</link>
      <description>&lt;P&gt;Consider where in the callstack you expect to be since the callstack may contain several function calls.&lt;/P&gt;&lt;P&gt;This logic returns the most recently called function.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    LOOP AT cl_abap_get_call_stack=&amp;gt;format_call_stack_with_struct(
        stack = cl_abap_get_call_stack=&amp;gt;get_call_stack( )
      )
      ASSIGNING FIELD-SYMBOL(&amp;lt;stack_line&amp;gt;).
      IF &amp;lt;stack_line&amp;gt;-kind = 'FUNCTION'.
        function_name = &amp;lt;stack_line&amp;gt;-event.
        EXIT.
      ENDIF.
    ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Feb 2022 18:55:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-i-get-the-function-name-from-within-a-function/m-p/1460196#M217290</guid>
      <dc:creator>ray_mannion</dc:creator>
      <dc:date>2022-02-04T18:55:34Z</dc:date>
    </item>
  </channel>
</rss>

