Application Development 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: 

How to read ABAP STACK of another report

Former Member
0 Kudos

Hi,

I wish to read the ABAP STACK of another report which may or may not be running in debugging mode.

First of all is it possible. if yes then pls reply.

Thanks

6 REPLIES 6

former_member186746
Active Contributor
0 Kudos

You can address another abap stack and influence it with a field symbol

for instance

FIELD-SYMBOLS <fs_with_closed> TYPE ANY.

IF sy-ucomm IS INITIAL.

ASSIGN ('(SAPLBBP_PDH_SEARCH)GS_SEARCH_FIELD-WITH_CLOSED') TO <fs_with_closed> .

<fs_with_closed> = 'X'.

ENDIF.

Kind regards, Rob Dielemans

Former Member
0 Kudos

Hello Rob,

Thanks for ur rreply.

My problem is that i'm running a report in debugging mode and i wish to obtain the program name and the line number of the current debugger position, in another program. That can be obtained by reading the stack of that report inside another report/ function module.

I tried your way but couldn't get the result i wanted. If u could explain a bit more on your solution or if you have another solution to my problem then it would be quite a help for me.

Thanks for your time and efforts.

Regards

Nitin Gupta

0 Kudos

Not sure I completely understand your requirements. However, function module SYSTEM_CALLSTACK might be something you want to look at. It gives the programs/routines on the call stack, though it doesn't give any information about line numbers...

Former Member
0 Kudos

Hello Harald,

I used 'ABAP_CALLSTACK' but it could fetch me the stack contents(including the line number) for the program from which i'm calling it from. I couldn't use it to fetch the stack contents of another program.

My aim is to obtain the program name and the line no. of another program ( which is running in debugging mode ) inside my current program, by any means.

Hope it clarifies my problem.

Regards

Nitin Gupta

0 Kudos

Hhhmm, ok, then I really didn't understand your request. Here's something that might come closer, but is actually of questionable value due to timing issues: Assuming that you know already the debugging takes place on the same application server you could call function module TH_GET_WPINFO and check for any processes with WP_WAITING = 'Debug'. For those take the work process number WP_NO and get the details via TH_WP_DETAIL_INFO (feeding the work process number into WP_INDEX and evaluating the parameter DIAREC-REPORT. However, this doesn't give you call stack and I'm pretty sure it always just contains the current main program that's running. Not to mention the fact that between the calls the debugging might have ended... (though in the second call it seems that WP_INFO-WP_ISTATUS = 8 seems to indicate that process is in debugging from the few tests that I did).

0 Kudos

Thanks man.

It didn't solve my problem though but i did learn something new.

I appreciate your efforts.

Regards Nitin