Developer Console

The Developer Console is a practical tool that allows tracing of scripts and business rules executed in the production system. The Developer Console allows you to analyze your actions in SAP CPQ easily, profile application problems and locate potential bottlenecks.
The Developer Console is accessible from the top menu, under the Setup menu item. The tool opens in a new tab so you can work on SAP CPQ and track actions and traces in parallel. The Developer Console captures up to 10,000 traces per request (a request is a click in the application). When you first access it, the Developer Console is empty until you start working in the application.
cpq_1908_developer_console_setup.jpg


Example: If you need to track and analyze all actions that have been performed on a quote in SAP CPQ, click Developer Console and the tool opens in a separate tab. Select the Full Mode checkbox. In the first tab, open the quote whose actions you wish to analyze. If you go back to the Developer Console, you can see that all the actions you performed on the quote from the moment you first opened the console are listed. Also, all future actions that you will perform on the quote will also be recorded in the console.


Depending on the data you wish to track in the Developer Console, you can select/unselect these checkboxes:

  • Trace - enable/disable tracing of all actions in SAP CPQ.
  • Trace App Params - select to trace application parameters and their values. This is applicable only for actions controlled by application parameters.
  • Full Mode - select to view traces related to all actions performed in SAP CPQ. Otherwise, if you do not select the option, only traces that are related to products, rules and scripting are displayed. If you wish to switch between the default and the full mode, you need to check/uncheck the Full Mode checkbox and repeat the user action.
  • Disable UI Customizations - select to disable any customization made to the template and branding and to revert SAP CPQ to the default template and branding. The customization is disabled only during the current session. This feature helps administrators during troubleshooting to establish if a UI issue is caused by a broken customization.


All data tracked in the Developer Console is organized into Actions, Groups and Trace.

Actions

As you perform actions in SAP CPQ, the Developer Console refreshes and new data is added to the list of actions and traces. The tool lists only actions that you performed during the current session. A good practice is to clear the Developer Console by clicking Clear, and then perform actions in the application. This way you will have a clearer overview of the data related only to a particular action.
The list of tracked actions is displayed in the header of the Developer Console. To collapse/expand the section, click Hide actions and Show actions, respectively. All listed actions have time stamps, duration in seconds and available actions (view, download and performance). If an error occurs, the action's information is displayed within the table with red background that indicates that the action is somehow erroneous. To see details of an action, click on the action's row, and all the details will be displayed within Trace.

Performance Details

The Performance details dialog box provides a more detailed overview of the performance of a particular action. To view performance details of an action, click next to the action.


For the GetInitData action, the dialog box displays performance details for logs labeled Quote Parser.


Tags used for the quote in question are logged for Quote Parser. For logs labeled Quote Parser, the Performance details table displays the following information:

  • Name - The name of the log.
  • Count - The number of logs labeled Quote Parser whose duration is greater than 0.
  • Average Time (s) - The average duration (in seconds) of logs labeled Quote Parser.
  • Slowest Time (s) - The slowest duration (in seconds) of logs labeled Quote Parser.
  • Total Time (s) - The total duration (in seconds) of logs labeled Quote Parser. The percentage shown in brackets represents the total duration of logs labeled Quote Parser compared to the total duration of the action in question.

Trace

This section displays a detailed trace for every action recorded in the Developer Console. The data is displayed chronologically, in the order that the actions had taken place.

You can filter the trace by:

  • Message - detailed description of the trace. If you select Negative Filter and enter a search term, the system displays only the lines that do not contain that term in the description. This field also allows filtering support for special search characters: question marks and asterisks. The question mark replaces one character and the asterisk replaces any character and any number of characters.
  • Logger - the class from which the method was initiated.
  • Level - Trace H are high-level traces and Trace L are low-level traces.
  • Labels - a label describing the trace (such as Scripting, QuoteParser, or DatabaseQuery).
  • duration (ms) - the time needed for the method to execute.
  • from parent (ms) - the time needed for the parent method to trigger the current method.

Formula errors are logged in the Trace section with the log level Error and the label Formula Error.

If you want to focus on one trace line, enter a search term in a column to find the trace and select the line. If you remove the search term, the line remains selected and all other trace lines are displayed again.

If you want to rearrange actions to view the slowest actions first, click Slowest first in the duration (ms) column. This rearranges the trace lines so that the slowest actions are displayed on top. You can click the action you are interested in and unselect the Slowest first checkbox, and the selected trace line remains selected, allowing you to see the context in which the action was executed.

Logs which show up when scripts attached to events are triggered are labeled ScriptEvent. All other scripts have the Script label.

To view more trace details, click .

The flag ITrace.IsOn, which is available in scripting, indicates whether tracing is turned on or off. With the help of this flag, users can organize the logic that is related to tracing and, that way, optimize script execution time.

Breadcrumbs and Pin

When you are analyzing your trace lines, you can use the breadcrumbs to check how you arrived to the line and view actions that occurred. In the trace list, click . Other traces are removed from the list, so that only the pinned trace and its children traces are displayed, and the breadcrumbs display above the list. By pinning, you can isolate a group of traces within one action and focus on analyzing them. Using this feature affects groups on the left-hand side. Clicking the same icon removes the breadcrumbs and all data is displayed in Trace. If you select a particular group, only the content of that group is displayed. Doing so is useful when you have extensive data.

Groups

The Groups section lists the main traces (high level traces - Trace H) so you can expand them and have a hierarchical overview of the underlying traces. You can filter groups by entering a keyword. The filter can also be negative (for example, you can choose to view all the traced lines that don’t contain a particular word, such as clone, for example). The feature also enables filtering support for characters, asterisks and question marks. The question mark replaces one character and the asterisk replaces any character and any number of characters.

Keyboard Shortcuts

There is a set of keyboard shortcuts you can use to easily navigate between actions and trace lines. Press + to open the list of shortcuts:

Examples

This section describes some typical scenarios when you can use the Developer Console to debug your SAP CPQ.

Retracing and Debugging Iron Python Scripts

This feature is explained through a simple example script:

a = 0;
Trace.Write("a is initialized.")
a = 100;
Trace.Write("a is changed.")


This script initializes one variable “a”, traces the variable, and later updates the value of the variable to 100 and traces it once again. When the script gets executed (for example, after the quote has been changed), the Developer Console logs two trace messages and displays them.

Scripts have an interface for writing the trace and the log using Trace.Write and log.Write. Log data is visible in the event log and this interface can be used to log information that is useful for monitoring while the trace interface should be used for debugging data. It is important not to overuse the log feature because your log form will end up full of data that may not be useful. Also, if you log too much, you will slow down your scripts because logs are much slower to process than the trace. Ultimately, unlike the trace, the log is persistent, which makes it useful for monitoring and analysis, but it is preferable to use the trace interface instead of the log whenever that is possible.

When you set your script to be a post action for Generate Documents, make sure to use Log.Write to log your data and any messages. Avoid using Trace.Write since it does not get recorded in the Developer Console. This only applies to the Generate Documents action.

Tracking Attribute Changes During Rule Execution Loops

Tracking attribute changes during rule execution loops can help you understand why the system is maybe slower than usual. For example, if your product rules overlap, SAP CPQ will take longer to execute the rules.
For example, the product Network cable has two rules attached to it: if Category 6 is selected, the cable length is set to 100 meters and if the length of the cable is over 100 meters, then the Category 6 must be selected. If users first set the cable length to 110 meters, then both rules are executed. The first rule sets the cable category to Category 6 and the second rule sets the cable length as a result of the Category 6 setting (100 meters).


In scenarios like this, rules are always going to be performed in two loops, because the two rules correlate. The Developer Console records execution of rules, and displays a message that describes why the system is running slower.

You are here: SAP Sales Cloud CPQ Online HelpUser Side HelpEvent Log and Developer ConsoleDeveloper Console