Use function SYSTEM_CALLSTACK to display the call hierarchy (for
example, in error handling). Using this function, you can show this extra
information to help analyze the problem.
This function works on a Basis system -- version 4.6 C or higher.
REPORT zz_system_callstack.
* Example of using the system callstack function
DATA: ta_callstack TYPE sys_callst,
wa_callstack LIKE LINE OF ta_callstack.
START-OF-SELECTION.
PERFORM call_routine_1.
*&--------------------------------------------------------------------*
*& Form call_routine_1
*&--------------------------------------------------------------------*
FORM call_routine_1.
PERFORM call_routine_2.
ENDFORM. "call_routine_1
*&--------------------------------------------------------------------*
*& Form call_routine_2
*&--------------------------------------------------------------------*
FORM call_routine_2.
CALL FUNCTION 'SYSTEM_CALLSTACK'
IMPORTING
et_callstack = ta_callstack.
LOOP AT ta_callstack INTO wa_callstack.
WRITE: / wa_callstack-progname,
wa_callstack-eventtype,
wa_callstack-eventname.
ENDLOOP.
ENDFORM. "call_routine_2
The output will look like this:
ZZ_SYSTEM_CALLSTACK FORM CALL_ROUTINE_2
ZZ_SYSTEM_CALLSTACK
Requires Free Membership to View
FORM CALL_ROUTINE_1 ZZ_SYSTEM_CALLSTACK EVENT START-OF-SELECTION
This was first published in December 2005

Join the conversationComment
Share
Comments
Results
Contribute to the conversation