Wednesday, January 12, 2011

Debugging the CRM Webclient

There are several ways to start debugging the CRM webclient.

1. Setting a breakpoint in the coding (i.e. in a BADI or in the BSP Workbench)
2. Conditional Breakpoints

1. Setting breakpoints in the coding.
If you know what code you want to debug, of course you can easily set a breakpoint in the coding, and when calling a screen in the webclient (or clicking a button or whatever), the debugger will automatically pop up. Note that only external breakpoints will be considered from the webclient.

If you do not know exactly where a problem is occurring, you can also try running a SQL trace using transaction ST05. In the trace, doubleclick on the line you are interested in in the column containing the operation (like OPEN, PREPARE or FETCH). This will open the ABAP statement where the database call was made. You can now set a breakpoint here. Running again will pop up the debugger.

2. Conditional breakpoints.
The use of conditional breakpoints can be activated using transaction SAAB. In SAAB, enter checkpoint group CRMUIF_CONDITIONAL_BREAKPOINTS, and click the activate button.
In the personal activation box, tick the ‘BREAK' radiobutton under ‘Asserts’ and save.

Setting conditional breakpoints can be done in the webclient using <alt>-F2.
This will open the following window:

Useful conditional breakpoints are for instance:

UI Framework – Common Application Features -> Navigation via Navigation Bar or Cross Component.
This will break on every screen change.

UI Framework -> Create Text Message
This will break when a message is raised.

UI Framework -> 4) View Controller - Handle Event (*)
This will break when an event is raised.

UI Framework -> 9) View Controller – Do Prepare Output
This will break on the do_prepare_output (the generation of a screen).

Generic Interaction Layer -> GenIL Component – Get Query Result
This will break before a GenIL query is called.

1 comment:

  1. Hi

    This blog is very useful. Could you please provide the step - How to debug enduser session?

    Thank you