Break point for SELECT statement with Table Filter
In some occasions we need to find exactly where a SELECT statement is done for a particular table.
We can use breakpoint for SELECT statement but, most probably, the debugging session can be hard due to the number of hits we can get.
We can use some traces transaction like ST05 or ST12, but we need to switch ON/OFF the trace and then analyse the result.
To go straight forward and find exactly the place in the code where table, or a group of them, are being involved in a SELECT statement we can use Filter Criteria for the Breakpoint.
2. TEST CASE
Imagine that we want to identify where tables EKKO and EKPO are being selected during execution of Transaction Code ME23N – Display Purchase Order
Start a debugging session:
Run TCode ME23N and press ENTER:
Just after debugging environment is available, create a Breakpoint for SELECT statement:
Now go to “Break./Watchpoints” tab:
Select the line for Breakpoint created and press “Define Filter”:
Select RSTPDA_SCRIPT_BP_SQL_DBTAB filter option:
Now write the table you want to focus on:
Actually this is a Select Options, so you can decided the tables as you wish:
Then, accept the selection criteria. You can decide to save the breakpoint but although breakpoint will be available for next run the filter is removed so just put it back if you need to debug again:
Go to Desktop 1 tab:
Press F8 … Hit for EKKO reached!
Press F8… again another EKKO selection:
Now EKPO hit!:
And another EKPO selection found!:
We can save much time to find out where a particular table is used in a SELECT statement or where to develop an enhancement after the SELECT.
Finally mention that his approach is also working when SELECT statement is built with dynamic table name:
Alfonso Rodríguez Pérez.
SAP ABAP Consultant.