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

Find source code from SQL trace in ST01

Former Member
0 Likes
596

Hi All

I'm trying to find the source code for select statements found through a trace in ST01 programmatically. When you run a trace and analyse it through ST01, you can view individual select statements and when you click on a button SAP will forward navigate to the OpenSQL statement somewhere in the code. I want to be able to do this through code, in other words load the trace file, loop over it, find these "references" and then find the OpenSQL code.

I already have code to open the trace files and load the individual records, but I can't find a way to get back to the source code of each record. Each record contains the name of the program which contains the code, but that is about it.

Any and all help will be appreciated!

2 REPLIES 2
Read only

Former Member
0 Likes
487

try with ST05.

When u double client on the Line of the Trace , then it will goes to program itself. U have to cliec @ OPEN Commands only.

SAPLITSR TPS01 PREPARE 88 0 R/3 SELECT FROM "TPS01" ORDER BY "PROCS"

SAPLITSR TPS01 OPEN 88 0 R/3 SELECT FROM "TPS01" ORDER BY "PROCS"

SAPLITSR TPS01 FETCH 88 755 276 1403 R/3

regards

Prabhu

Read only

0 Likes
487

I can view the SQL trace through ST01, so ST05 would make no difference. What I need to do is find the source code <i>programmatically</i>, which means I can't just view ST01 or ST05 - I need to run through the actual trace file in code and find the point where it originated in the program ...