‎2008 Jan 10 6:03 PM
I need to know if a particular program is in the ABAP stack at a specific point in my code. The program I am looking for is not the calling program so SYST (CPROG, etc.) will not work.
Does anyone know a way (method or function module) to read the ABAP stack?
Thanks,
Mike
‎2008 Jan 10 7:57 PM
Hi Mike,
you can use the system call ABAP_CALLSTACK like this:
-
...
DATA: BEGIN OF ls_abap_callstack,
mainprogram LIKE sy-repid,
include LIKE sy-repid,
line TYPE i,
eventtype TYPE dbglevtype,
event TYPE dbglevent,
flag_system,
END OF ls_abap_callstack.
DATA: lt_abap_callstack LIKE TABLE OF ls_abap_callstack.
CALL 'ABAP_CALLSTACK'
ID 'DEPTH' FIELD 1
ID 'CALLSTACK' FIELD lt_abap_callstack.
...
-
Kindly regards,
Stefan
‎2008 Jan 10 6:34 PM
‎2008 Jan 10 7:57 PM
Hi Mike,
you can use the system call ABAP_CALLSTACK like this:
-
...
DATA: BEGIN OF ls_abap_callstack,
mainprogram LIKE sy-repid,
include LIKE sy-repid,
line TYPE i,
eventtype TYPE dbglevtype,
event TYPE dbglevent,
flag_system,
END OF ls_abap_callstack.
DATA: lt_abap_callstack LIKE TABLE OF ls_abap_callstack.
CALL 'ABAP_CALLSTACK'
ID 'DEPTH' FIELD 1
ID 'CALLSTACK' FIELD lt_abap_callstack.
...
-
Kindly regards,
Stefan
‎2008 Jan 11 8:16 PM
Thanks Stefan. (I decided to use fm 'SYSTEM_CALLSTACK' instead of the system call). Either way it works great.
Thanks again,
Mike