Entering content frame

Procedure documentation Starting and Stopping Debugging Sessions Locate the document in its SAP Library structure

Use

You use this procedure to start and stop sessions to debug HTML templates.

You can:

Prerequisites

You have set up your environment, as described in HTMLBusiness Debugging.

If you fail to do this, your debugging session will not work.

Note

You can only debug sessions that are initiated by a Web browser that is running on the same machine as the SAP@Web Studio.

Procedure

Debugging New Sessions

  1. Set breakpoints in the code:
    1. Open the HTML template you want to debug.
    2. Place the cursor on the line where you want to insert a breakpoint.
    3. Hit F9 or choose Toggle Breakpoint on the Debug toolbar or choose Debug ® Toggle Breakpoint.

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

Setting and deleting breakpoints is a toggle operation. To delete the breakpoint you have set, hit F9, choose Toggle Breakpoint on the Debug toolbar or choose Debug ® Toggle Breakpoint.

    1. If required, set implicit breakpoints to be hit when the interpreter starts or finishes executing the file.
    2. If required, set hardcoded breakpoints.
    3. If required, set watchpoints.
    4. Repeat this procedure for as many breakpoints you want to set and for as many HTML templates as you want to debug.

You can also disable breakpoints temporarily and re-enable them at any time.

  1. Connect to the AGate server:
    1. Choose Debug ® Attach Server.
    2. You see the Select Server Session dialog, which displays a list of currently active sessions and their status.

      This graphic is explained in the accompanying text

      There may be no currently active sessions.

    3. Select Debug ® New Session.
    4. Choose OK.

The SAP@Web Studio posts a debugging request.

  1. Start the service you want to debug.

When you do this, the AGate server initiates an ITS session, binds the session to the pending debugging request and activates the breakpoints and watchpoints you have set.

When the session hits a breakpoint (whether set explicitly in the code or implicitly), the debugger displays the HTMLBusiness code at the line currently being executed and opens three debugging windowsHTML Output, Variables and Call Stack.

  1. Execute the program in debugging mode.

Debugging Active Sessions

To debug active sessions (that is, sessions that have not yet timed out), all you need to do is connect to the AGate server.

  1. Choose Debug ® Attach Server.

You see the Select Server Session dialog, which displays a list of sessions and their status. The handling of sessions depends on their status:

The dialog lists the source file name and current line number.

The dialog lists these sessions as idle.

The dialog lists these session as running.

  1. Select the session you wish to debug.
  1. Choose OK (or double-click the session).

When a connection has been established, the debugger activates and watches for all the breakpoints and watchpoints you have set.

You can also set new breakpoints as described above for debugging new sessions or maintain breakpoints and watchpoints in the breakpoints dialog.

If the session is currently executing the file (especially if it is stuck in an endless loop), you can interrupt the program execution and transfer control to the debugger. To do this, choose Break on the toolbar or Debug ® Break.

  1. Execute the program in debugging mode.

Stopping Debugging Sessions Explicitly

A debugging session terminates when the ITS session terminates, but you can also stop debugging sessions explicitly at any time.

To do this, choose Debug ® Finish Debugging.

The ITS monitors debugging sessions regularly. If they are left idle for a long time without any user action either on the Web browser side or the debugger side, the session times out and is terminated. When this happens, the SAP@Web Studio displays a warning message.

Leaving content frame