[ABAP] System Callstack (Aufrufreihenfolge) abrufen

DATA: it_abap_callstack TYPE abap_callstack.
DATA: it_syst_callstack TYPE sys_callst.

CALL FUNCTION 'SYSTEM_CALLSTACK'
  EXPORTING
    max_level    = 1
  IMPORTING
    callstack    = it_abap_callstack
    et_callstack = it_syst_callstack.

LOOP AT it_abap_callstack ASSIGNING FIELD-SYMBOL(<a>).
  WRITE: / <a>-mainprogram,
           <a>-include,
           <a>-line,
           <a>-blocktype,
           <a>-blockname,
           <a>-flag_system.
ENDLOOP.

LOOP AT it_syst_callstack ASSIGNING FIELD-SYMBOL(<s>).
  WRITE: / <s>-progname,
           <s>-eventtype,
           <s>-eventname.
ENDLOOP.