ABAP--如何获取ABAP的程序的调用堆栈

REPORT demo_mod_tech_perform_int .

DATA: num1 TYPE i,
      num2 TYPE i,
      sum  TYPE i.

num1 = 2. num2 = 4.
PERFORM addit.

FORM addit.
  sum = num1 + num2.
  PERFORM out.
ENDFORM.                    "addit

FORM out.
  field-symbols: <fs> type any.
  data l_cstack_tab  type SYS_CALLST.

  WRITE: / 'Sum of', num1, 'and', num2, 'is', sum.
  CALL FUNCTION 'SYSTEM_CALLSTACK'
    IMPORTING
      et_callstack = l_cstack_tab. " internal table
* l_cstack_tab 里就是abap的调用堆栈
   
ENDFORM.                    "out

你可能感兴趣的:(ABAP--如何获取ABAP的程序的调用堆栈)