The SmartForms trace allows us to trace the processing of the Smart Form during printing. It can be analyzed to determine the sequence of the processing of the nodes and the point at which the processing was terminated due to an error.
SAP SmartForms Trace
To trace the SAP SmartForms processing, the SFTRACE transaction is used. When a trace is activated using the generated function module, the Smart Form stores the trace for each output in the database. The degree of the details of the trace can be set. The trace is automatically deactivated after a day; however, the trace files are retained. The trace output is user-specific which means it is activated only for the user who activated it.
The following settings are available if the trace is active:
- Level: Determines the degree of the details of the trace.
- Logical Page (Name): Restricts the trace output to a specific page.
- Window: Restricts the trace output to a specific window on a page.
- ABAP Breakpoints: Warning and Error options are used internally.
This determines the degree of the details of the trace. Level 5 contains general information while Level 80 contains the most detailed trace.
The following are the trace levels:
- Warning or error (Level 5): It contains trace level, trace version, system date and time, and system information.
- Document information (Level 15): It contains additional information like output channel, form attributes, form structure, and output results.
- Pages (Level 30): It contains additional information like the name of the processed pages (except the name of the start page).
- Window (Level 40): It contains additional information like names of the processed windows
- Output area (Level 45): It also contains information about the table output area.
- Cell change (table) (Level 47): It also contains the outputs on line types and cells processed in the tables.
- Text information (Level 50): It also contains attributes values of the processed output nodes like text elements, text modules, etc.
- Fields (Level 60): It also contains the names and values of the fields in the text outputs,
- Scanner token (Level 80): It is the maximum trace level and also contains the scanner outputs when analyzing the texts in the text nodes.
Activating and Configuring the Trace
The trace is deactivated by default. To trace the form, trace has to be activated and configured. Steps to activate and configure the trace:
- Enter SFTRACE in the common field.
- Click on Switch On Once clicked, the status changes from Trace Inactive to Trace Active.
- Set the trace level and other settings.
- Press Enter to confirm the entries.
Once the trace is active for the user, whenever the Smart Form is called, a new trace is created every time. The trace is automatically deactivated after a day; however to manually deactivate the trace click on Switch Off pushbutton.
Analyzing Trace Output
Traces are stored in the Traces in the database frame of the SFTRACE transaction window. Use the Refresh button to get the updated trace.
To analyze the trace in the system:
- Select the line by pressing the pushbutton on the left side of the table.
- Click on Display Trace to see the trace screen.
The traces can be stored locally by selecting the Export button. To read the locally stored trace, select Read trace from local file button.