Entering content frameProcedure documentation Setting Breakpoints and Watchpoints Locate the document in its SAP Library structure

Use

You use this procedure to set breakpoints and watchpoints in HTMLBusiness code.

You can:

Procedure

Setting and Managing Breakpoints

You set breakpoints in HTMLBusiness code directly. To do this:

  1. Place the cursor on the line where you want to insert a breakpoint.
  2. Hit F9, choose Toggle Breakpoint on the debug toolbar or choose Debug ® Toggle Breakpoint.

A red disk ( This graphic is explained in the accompanying text ) indicating the breakpoint appears at the beginning of the line.

When you have set breakpoints, there are two methods you can use to manage them:

Managing Breakpoints Directly in the Code

The following table lists and describes the functions for managing breakpoints directly:

Function

Procedure

Disable a breakpoint temporarily

  1. Place the cursor on the line where you want to disable a breakpoint.
  2. Choose Debug ® Disable Breakpoint.

The red disk (enabled breakpoint) becomes a red circle (disabled breakpoint).

Enable a disabled breakpoint:

  1. Place the cursor on the line where you want to enable a breakpoint.
  2. Choose Debug ® Enable Breakpoint.

The red circle (disabled breakpoint) becomes a red disk (enabled breakpoint).

Delete a breakpoint

  1. Place the cursor on the line where you want to delete a breakpoint.
  2. Hit F9, choose Toggle Breakpoint on the debug toolbar or choose Debug ® Toggle Breakpoint.

The red disk indicating the breakpoint disappears from the beginning of the line.

Managing Breakpoints in the Breakpoints Dialog

You can also manage breakpoints in the SAP@Web Studio Breakpoints dialog.

The following table lists and describes the functions for managing breakpoints with the SAP@Web Studio Breakpoints dialog:

Function

Procedure

Disable a breakpoint temporarily

  1. Choose Debug ® Edit Breakpoints.
  2. Select the Location tab page.
  3. Deselect the breakpoints you want to disable.

Enable a disabled breakpoint

  1. Choose Debug ® Edit Breakpoints.
  2. Select the Location tab page.
  3. Select the breakpoints you want to enable.

Delete a single breakpoint

  1. Choose Debug ® Edit Breakpoints.
  2. Select the line where you want to delete a breakpoint.
  3. Choose Remove.

Delete all breakpoints

  1. Choose Debug ® Edit Breakpoints.
  2. Select the line where you want to delete a breakpoint.
  3. Choose Remove All.

Specify the number of times you want the debugger to skip a breakpoint before stopping

  1. Choose Debug ® Edit Breakpoints.
  2. Select the line containing the breakpoint for which you want to specify the skip count.
  3. Enter a value in the appropriate field.

Setting and Managing Watchpoints

To monitor the values of variables and array elements, you can set and manage watchpoints in the SAP@Web Studio Breakpoints dialog.

To set watchpoints:

  1. Choose Debug ® Edit Breakpoints.
  2. Select the Data tab page
  3. Double-click on the next blank line in the list box and enter the name of a variable <variable> or an array element <variable>[<index>].

When the value of this variable or array element is modified during program execution, an implicit breakpoint is set. This interrupts the program and passes control to the debugger.

If you enter xyz in the dialog and this is the name of the array, an attempt to modify any element of the array causes the watchpoint to be hit.

If you set a watchpoint for xyz, attempts to change the values of xyz[1], xyz[2], xyz[3] or any other element in the array all cause the watchpoint to be hit.

If you set a watchpoint for a.b.c, this detects any changes made to a[1].b.c, a[2].b.c and so on. If you only want to monitor the element a[1].b.c (and no other a[*].b.c element), you must specify a[1].b.c explicitly as the watchpoint name.

  1. If required, you can define a context for a watchpoint by specifying a function or file name.
  2. The context acts as an additional filter, which specifies that a watchpoint is active only within the specified function or file. This means that any changes made to the variable in any other function or file are ignored.

  3. Choose OK.

To edit watchpoints you have set:

  1. Choose Debug ® Edit Breakpoints.
  2. Select the Data tab page.
  1. Choose OK.

Setting Implicit Breakpoints

You can set implicit breakpoints to be hit when the HTMLBusiness interpreter starts or finishes executing an HTML template. To do this:

  1. Choose Debug ® Preferences or Tools ® Options ® Debugger
  2. Select the General tab page.
  3. In the HTMLBusiness group box, set the following options as required:

Hardcoding Breakpoints

Sometimes, it is useful to set breakpoints by embedding them in the code. To hardcode breakpoints in HTML templates, insert the HTMLBusiness function debugger().

When executing this call, the HTMLBusiness interpreter stops at the breakpoint. You can then connect to the server and start a debugging session.

Leaving content frame