Friday 26 July 2019

Break point for SELECT statement with Table Filter

1. OVERVIEW


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.

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:

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

Press ENTER:

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

Run TCode ME23N and press ENTER:

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

Just after debugging environment is available, create a Breakpoint for SELECT statement:

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

Now go to “Break./Watchpoints” tab:

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

Select the line for Breakpoint created and press “Define Filter”:

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

Select RSTPDA_SCRIPT_BP_SQL_DBTAB filter option:

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

Now write the table you want to focus on:

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

Actually this is a Select Options, so you can decided the tables as you wish:

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

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:

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

Go to Desktop 1 tab:

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

Press F8 … Hit for EKKO reached!

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

Press F8… again another EKKO selection:

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

Now EKPO hit!:

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

And another EKPO selection found!:

SAP ABAP Certifications, SAP ABAP Online Exam, SAP Study Materials, SAP ABAP Development

No comments:

Post a Comment