Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Get current FORM-Routine Name

Former Member
0 Likes
1,511

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

4 REPLIES 4
Read only

former_member189059
Active Contributor
0 Likes
807

See these fields

sy-CPROG

sy-XPROG

sy-XFORM

sy-LDBPG

sy-TITLE

reward helpful answers

Read only

0 Likes
807

Hi Kris,

thanks for Your reply. Syst-variables won't work.

I tried that one first.

Best regards,

Gunther

Read only

Former Member
0 Likes
807

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

Read only

0 Likes
807

Hi Philippe,

excellent. Thank's for Your helpful reply!

Gunther