06-18-2004 11:34 PM
Hi all,
as anybody an idea how I can get the calling name of a function module within the function module itsself.
ie.
CALL FUNCTION 'Z_TEST_DMO'.
...
Within this function module I want to know the name of the function module. In this case: Z_TEST_DMO. The think is that I want to react on the suffix DMO for some dynamic programming purposes.
sy-repid doesn't give me the necessaty information.
An Classes like CL_ABAP_RUNTIME and so one seems not to be the correct approach. As anyone an idea how I can get the information.
Thanks in advance
Cheers
jm
06-18-2004 11:53 PM
06-19-2004 11:34 AM
Hi Serdar,
thank you very much for your quick help. It solved my problem! Sorry for not having found it in the already discussed thread. My version:
DATA l_i_callstack TYPE sys_callst.
DATA l_var_functionname(70) TYPE c.
FIELD-SYMBOLS <l_callstack> TYPE LINE OF sys_callst.
CALL FUNCTION 'SYSTEM_CALLSTACK'
IMPORTING
et_callstack = l_i_callstack.
READ TABLE l_i_callstack ASSIGNING <l_callstack>
WITH KEY eventtype = 'FUNC'.
IF sy-subrc EQ 0.
MOVE <l_callstack>-eventname TO l_var_functionname.
ENDIF.
Cheers
Jeannot
Message was edited by: Jeannot Dr. Muller