Carrying out SQL trace

In this recipe, we will see how we can carry out an SQL trace. We will run the trace on the program RIBELF00 (Display Document Flow).

How to do it...

We will now carry out the following steps:

  1. In one SAP session, open the transaction that is to be traced. In our case, we have to trace the program RIBELF00. We enter on transaction SE38 the program name in the field provided, and execute the program in order to display the selection screen. We will not execute the program, yet we will enter the input values on the selection screen.
  2. Then, open another session and call transaction ST05. The screen appears, as shown in the following screenshot:
    How to do it...
  3. Make sure the SQL trace checkbox is on. Click the Activate Trace button on the toolbar. Make sure that before doing this, the message in the lower part of the screen reads, All Traces are Switched Off….
  4. Now return to the first SAP session and execute the report with the relevant input values, as shown in the following screenshot:
    How to do it...
  5. Once the output is displayed, go back to the SQL trace session and click on the Deactivate Trace button.
  6. Then, click on the Display Trace button to generate the results.

How it works...

The Activate Trace button switches on the database trace. Then, any database-related activity related to SELECT and UPDATE statements are recorded. This may be displayed using the Display Trace button.

For carrying out a trace, you may even stop a program in the debugger in one session and then switch on the trace in another session. In addition, you may enter data on a SAP entry screen and just before pressing the Save button, switch on the SQL trace, and then switch off the trace after Save is pressed and the success message appears. In this case, all database statements are executed between the time the Save button is pressed and the message display are recorded.

It is recommended that you run only the concerned program transaction and stop any other activity. Otherwise, many irrelevant entries will also be included in the trace result, making it very large and difficult to read.

The next recipe will cover how the trace results may be displayed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.93.175