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 do I get the ABAP Stack of another program?

0 Kudos

I want to get the complete ABAP stack of another program in my program.

For example, ZTEST1 is a program which is executing at the time.

I have a program ZTEST2 and I want to retrieve the ABAP stack information of ZTEST1 in ZTEST2.

Also, I do not wish to make any modifications in ZTEST1.

Is it possible to do this? If yes, any help would be appreciated.

7 REPLIES 7

matt
Active Contributor

Why do you want to do this? What are you trying to achieve?

0 Kudos

Hi Matthew,

Thanks for your time and helping me on this.There are hundreds of interfaces which are running currently in sap system ,These interfaces transfer the messages between systems (sap to non-sap ) based on some custom configuration.Unfortunately we don't having the track of these interfaces, running for which business process(business scenario).

we have the one base FM which will be called before the actual interface executes. So trying to find out ,is there any way to collect the ABAP stack when ever this Particular FM active/running.if we are able to collect this stack info , then we will get to know what is the triggering point of business process.

Thanks

Purna

0 Kudos

Hi Purna,

Check out the code of FM TH_DUMP_ABAP_STACK. It should be a relatively simple task to convert this for your own purposes.

It will show you how to call C-function 'ABAP_CALLSTACK'. This provides the information you are looking for.

kr

mh

0 Kudos

Hi Purna,

Just to make sure I understood right: you can only retrieve the active call stack of the active program that you include the above code into...

I do not think there is any way to retrieve the active call stack of ANOTHER program that is executing at the same time...

kr

mh

0 Kudos

Hi Hesen,

Thank you for replying . yes , FM is giving the active call stack of current running program.

My requirement is like

I have one FM which which Triggers when ever message goes out/come in to SAP but problem is like we dont know what the exact scenarios which is executing(Triggering point ) this FM.

So I am trying to find out, is there any way to backtrack the info (collecting abap stack ) from Current LUW to previous LUWs( if any) where the process started and already finished execution blocks info.

Thanks

Purna

vinita_kasliwal
Active Contributor
0 Kudos

Hi

Can you not check the ABAP stack using SPAM or using debugger ?

if you want in the ABAP program use FM SYSTEM_CALLSTACK

Read the code snipper in the links below

http://zevolving.com/2013/04/read-call-stack-to-check-on-called-program/

https://stackoverflow.com/questions/11499488/how-to-get-the-program-call-stack-trace-in-abap

let me know if that helps

Regards

vinita

pokrakam
Active Contributor

What about using a good old fashioned where-used list?

Or get the FM to dump some data into a trace table by which you can trace back the business context.