<?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: Do Function-Modules know their own name ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-function-modules-know-their-own-name/m-p/4117713#M984376</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found a solution myself:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION ZTESTSTACK.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  EXPORTING
*"     REFERENCE(E_MAINPROG) TYPE  SY-REPID
*"     REFERENCE(E_INCLUDE) TYPE  SY-REPID
*"     REFERENCE(E_EVENT) TYPE  ABDBG-LEVENT
*"----------------------------------------------------------------------
  TYPES:
  begin of abap_call_stack_entry,
    mainprogram like sy-repid,
    include like sy-repid,
    line type i,
    eventtype like abdbg-leventtype,
    event like abdbg-levent,
    flag_system type c,
  end of abap_call_stack_entry.
  DATA:
  acse type abap_call_stack_entry,
  tab type table of abap_call_stack_entry.
  CALL 'ABAP_CALLSTACK' ID 'DEPTH' FIELD 2
  ID 'CALLSTACK' FIELD tab.
  read table tab index 2 into acse.

  e_mainprog = acse-mainprogram .
  E_include = acse-include.
  E_event = acse-event.

ENDFUNCTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This Fm returns the actual function. Hte first entry in itab would be the FM ZTESTSTACK itself. So I have to take the second one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Aug 2008 11:22:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-11T11:22:01Z</dc:date>
    <item>
      <title>Do Function-Modules know their own name ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-function-modules-know-their-own-name/m-p/4117711#M984374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can a function-module send its own name ? If I use sy-repid, I only get the Function group. &lt;/P&gt;&lt;P&gt;I also need this for methods in classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all&lt;/P&gt;&lt;P&gt;Stefanie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2008 07:38:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-function-modules-know-their-own-name/m-p/4117711#M984374</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-07T07:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Do Function-Modules know their own name ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-function-modules-know-their-own-name/m-p/4117712#M984375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could cheat and create a constant with the name of the function module, method, class, etc... in the appropriate place and then reference that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2008 07:40:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-function-modules-know-their-own-name/m-p/4117712#M984375</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-07T07:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Do Function-Modules know their own name ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-function-modules-know-their-own-name/m-p/4117713#M984376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found a solution myself:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION ZTESTSTACK.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  EXPORTING
*"     REFERENCE(E_MAINPROG) TYPE  SY-REPID
*"     REFERENCE(E_INCLUDE) TYPE  SY-REPID
*"     REFERENCE(E_EVENT) TYPE  ABDBG-LEVENT
*"----------------------------------------------------------------------
  TYPES:
  begin of abap_call_stack_entry,
    mainprogram like sy-repid,
    include like sy-repid,
    line type i,
    eventtype like abdbg-leventtype,
    event like abdbg-levent,
    flag_system type c,
  end of abap_call_stack_entry.
  DATA:
  acse type abap_call_stack_entry,
  tab type table of abap_call_stack_entry.
  CALL 'ABAP_CALLSTACK' ID 'DEPTH' FIELD 2
  ID 'CALLSTACK' FIELD tab.
  read table tab index 2 into acse.

  e_mainprog = acse-mainprogram .
  E_include = acse-include.
  E_event = acse-event.

ENDFUNCTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This Fm returns the actual function. Hte first entry in itab would be the FM ZTESTSTACK itself. So I have to take the second one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Aug 2008 11:22:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-function-modules-know-their-own-name/m-p/4117713#M984376</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-11T11:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Do Function-Modules know their own name ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/do-function-modules-know-their-own-name/m-p/4117714#M984377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefanie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Research. I Appreciate it. I may be helpful to me in the future.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Murthy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Aug 2008 11:37:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/do-function-modules-know-their-own-name/m-p/4117714#M984377</guid>
      <dc:creator>former_member787646</dc:creator>
      <dc:date>2008-08-11T11:37:24Z</dc:date>
    </item>
  </channel>
</rss>

