Skip to Content
author's profile photo Former Member
Former Member

Get the name of a function module within a function module

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jun 18, 2004 at 10:53 PM

    Hi!

    Something like your issue was discussed before about getting the name of the currently called method.

    And FM of 'SYSTEM_CALLSTACK' was found to be the solution.

    Hope this link works:

    get-name-of-current-method

    *--Serdar

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.