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

how to find which function used a certain sql statement in which programm.

Former Member
0 Likes
751

in the performance traces of st04 we find a certain sql statement performing very poorly.

SELECT

  *

FROM

  "HRP1001"

WHERE

  "MANDT" = :A0 AND "PLVAR" = :A1 AND "OTJID" = :A2 AND "SUBTY" = :A3 AND

  "BEGDA" <= :A4 AND "ENDDA" >= :A5

compared to a lot of other sql statements on the hrp1001 that perform well.

now I can find that this sql statement is used in

RH_BASE_READ_INFTY_1001

which relates to HRIQ_READ_INFTY_1001

but this function is used a couple of hundred times in different locations.

is it somehow possible to find or to set a trace with this certain sql statement to find which programm has an incomplete call to this function ( the parameter istat is omitted in this case)

with st05 it is not possible since I can only filter on hrp1001 and the amount of selects is so huge that even within a second I can get no trace back anymore and get an

File end of performance trace file detected -> See long text

Meldingsnr. 0S161

but even with st05 I will also get back all the other select statements on the hrp1001 which are performing perfectly

anybody got a clue of how to find where and in which situation a certain sql statement is called ?

kind regards

Arthur de Smidt

4 REPLIES 4
Read only

ThomasZloch
Active Contributor
0 Likes
644

Is it the "shared cursor cache" in ST04 you are looking at? You can drill down to the underlying ABAP code for any statement listed there, did you try that for your long running statement?

Thomas

Read only

0 Likes
644

yeps I have the statement and the abap code. but the it is a generic function which is used at a lot of different locations. now I want to find out how I can trace where the function is called with incomplete parameters.

Read only

Former Member
0 Likes
644

seems no answer possible to find the calling programm

Read only

yuri_ziryukin
Product and Topic Expert
Product and Topic Expert
0 Likes
644

Hello Arthur,

I can suggest you writing a so-called enhancement to the standard function module. In your custom code in the beginning of the function module you can check when certain parameter from the selection is missing, get the call stack of ABAP and store it in some log table.

When you have enough information you can deactivate the enhancement again.

Regards,

  Yuri