‎2008 Jul 07 8:38 AM
Hello,
can a function-module send its own name ? If I use sy-repid, I only get the Function group.
I also need this for methods in classes.
Any idea ?
Thanks for all
Stefanie
‎2008 Jul 07 8:40 AM
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?
‎2008 Aug 11 12:22 PM
Hey Gurus,
I found a solution myself:
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.
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.
‎2008 Aug 11 12:37 PM
Hi Stefanie,
Good Research. I Appreciate it. I may be helpful to me in the future.
Thanks
Murthy