REPORT ZSAPeiros.
DATA:
lt_stack TYPE abap_callstack,
ls_stack TYPE abap_callstack_line.
CALL FUNCTION 'SYSTEM_CALLSTACK'
IMPORTING
callstack = lt_stack.
LOOP AT lt_stack INTO ls_stack.
WRITE:/ 'Programa principal:',ls_stack-mainprogram.
WRITE:/ 'Include :',ls_stack-include.
WRITE:/ 'Linha da chamada :',ls_stack-line.
WRITE:/ 'Tipo da chamada :',ls_stack-blocktype.
WRITE:/ 'Nome do processo :',ls_stack-blockname.
WRITE:/ 'Programa sistema :',ls_stack-flag_system.
ENDLOOP.