Show TOC

Tracing an ABAP ProgramLocate this document in the navigation structure

Context

Usage Notes
  • Run your program before tracing it: It's a good idea to run your program at least once before you trace it. That way, any side-effects of compilation, initialization of caches, or other time-users, are eliminated before you actually trace.
  • Trace status in the ABAP Traces view. Your traces should have the state Finished. If the program aborted or any other problem prevented successful tracing, then the trace is shown in red with the state Erroneous.
  • Trace user filter: The list in the ABAP Traces view shows all traces made under your user in the ABAP project in which you are currently working. The list includes traces from all servers of the back end system, but only those that are still stored as files. If you need to display a trace that is available only in a trace container in the database, then use transaction SAT in the integrated SAP GUI.

    If you want to see traces that belong to another user, click on the view menu of ABAP Traces and choose the function User Filter....

  • Optimizing ABAP Unit traces: If your class has a lot of ABAP Unit test methods, or if you want to trace only a single method, then start the trace from the Outline view. Put the cursor on the ABAP Unit test method that you would like to trace. Then choose Start of the navigation path Profile As Next navigation step ABAP Unit Test End of the navigation path from the context menu.
  • Scheduling a tracing request. ABAP methods and function modules cannot be started directly as applications. Running a method or function module starts the appropriate test framework in the integrated SAP GUI, but doesn't run the program so that you can trace it.

    As an alternative to tracing such a program in its ABAP Unit tests, you can Scheduling a Trace and trace the execution of a method or function module when its execution is triggered in the back end system by a transaction, HTTP request, or RFC call.

  • Other ways to trace a program that you cannot start directly: Start of the navigation path Trace As Next navigation step ABAP Application End of the navigation path
    • Embed code that includes the method or other object that you want to trace in an ABAP PROGRAM. You can then use Start of the navigation path Profile As Next navigation step ABAP Application End of the navigation path to trace the method.
    • Start the trace from transaction SAT in the back end system. You can, for example, set a breakpoint where you want to start tracing, launch the required transaction from SAT, and then start and stop the trace with OK codes /ron and /roff when you stop at the breakpoint in the debugger.

Procedure

  1. From the editor or from the Project Explorer, choose Start of the navigation path Profile As Next navigation step ABAP Application End of the navigation path or Start of the navigation path Profile As Next navigation step ABAP Unit Test End of the navigation path (Ctrl Shift F9).
    You can trace ABAP classes and other programs that you cannot start directly by running their ABAP Unit test methods. Only Start of the navigation path Profile As Next navigation step ABAP Unit Test End of the navigation path is offered with such programs.
  2. When your program has completed, switch to the Start of the navigation path ABAP Profiling End of the navigation path perspective.
  3. Open the Start of the navigation path ABAP Traces End of the navigation path view. The new trace should already be shown; if it is not, simply refresh the list of traces.
  4. Double-click on a trace to open it in the Overview view. You can also start the Trace Hitlist or the Call Tree (for non-aggregated traces) from the context menu of a trace entry.