‎2007 Jul 17 8:55 AM
Hi,
during runtime i want to know the current form-routine-name to write it in a variable and put it in an itab. The background-idea is to print out all procedures that have been executed after running the program.
Any hints, suggestions how to get this done?
Thanks in advance
Gunther
‎2007 Jul 17 9:00 AM
See these fields
sy-CPROG
sy-XPROG
sy-XFORM
sy-LDBPG
sy-TITLE
reward helpful answers
‎2007 Jul 17 9:05 AM
Hi Kris,
thanks for Your reply. Syst-variables won't work.
I tried that one first.
Best regards,
Gunther
‎2007 Jul 17 9:52 AM
Hi, Gunther,
The only way to do this is to read the ABAP Call Stack in an internal table.
Code:
TYPES: BEGIN OF t_s_abap_callstack,
mainprogram LIKE sy-repid,
include LIKE sy-repid,
line TYPE i,
eventtype LIKE abdbg-leventtype,
event LIKE abdbg-levent,
flag_system,
END OF t_s_abap_callstack.
variable for ABAP callstack
DATA: g_callstack TYPE STANDARD TABLE OF t_s_abap_callstack,
g_callstack_wa TYPE t_s_abap_callstack.
call 'ABAP_CALLSTACK' id 'DEPTH' field 99
id 'CALLSTACK' field g_callstack.
g_callstack now contains the program and routine names called, in sequence.
Pls be careful in using this C Call; in particular, usage in a Productive environment should only be envisaged with the utmost caution.
Philippe
‎2007 Jul 17 10:39 AM
Hi Philippe,
excellent. Thank's for Your helpful reply!
Gunther