Entering content frameProcedure documentation Performing Debugging Tasks Locate the document in its SAP Library structure

Use

You use this procedure to perform debugging tasks on HTMLBusiness code in HTML templates during debugging sessions.

You can:

You perform these tasks in various debugging windows.

There are also various debugging utility functions that allow you to:

Prerequisites

You have started a debugging session.

Procedure

Displaying HTMLBusiness Source Code

You can display HTMLBusiness code in the HTML Source view of the HTMLBusiness editor.

This allows you to:

)

The current location of program execution is indicated by a yellow arrow

If you choose to download the file from the server, the debugger downloads the file and opens it in a read-only source window. When you close this window, the memory holding the contents of this file is automatically released.

If the file versions do not match, you get a warning message stating that the copy on the server is not the same as the copy on your local machine. In this case, you are responsible for synchronizing the files.

You can display the values of variables, array elements and more complex expressions as tooltips.

Displaying and Editing Variables

You can display and edit all variables available to the program (including context variables and registers) in the Variables window.

For each variable, this window displays its name, value and attributes such as label, dim, min, max, vissize and maxsize.

You can edit the value and label. If you do this, the changes are reflected on the server. To edit a value (or label), double-click on it, change it and hit the Enter key.

To expand (or collapse) all levels for a variable that has multiple levels of nesting, press Ctrl and click the Expand/Collapse button at the same time.

To reflect the current program status, the debugger updates the contents of the variables window at each breakpoint or step in program execution. All changes since the previous step are displayed in red.

You can resize the width of columns in the Variables window.

Another way to display and edit variables is to use the Quick Watch dialog.

Displaying the Call Stack

You can display the call stack for executing the program in the Call Stack window.

The Call Stack window displays one entry for every function call or file include statement.

This displays the source code for the selected call frame at the current line of program execution.

The same indicator is also displayed next to the selected record in the Call Stack window.

When you switch the current context to a particular call frame, the Variables window is updated to reflect the program status for the selected frame. Register variables not defined for the frame are hidden. If a variable with the same name is defined in more than one scope (with a nested scope overshadowing an outer one), frame navigation ensures that the value displayed in the Variables window is appropriate for the selected frame (and that any changes to the variable are directed to the correct copy of the variable).

Displaying the HTML Output

You can display the standard HTML and HTMLBusiness code generated so far during a debugging session in the HTML Output window.

As you execute the program, more code is displayed here.

Displaying Messages Generated by the Debugger

You can display messages generated by the debugger in the message area, which is located at the bottom of the SAP@Web Studio’s frame. To display output messages from HTMLBusiness code in this window, you can use the standard HTMLBusiness function debugout()

For example:

debugout("This is", "the first", "line\r\nOne more", "line\r\n")

If debugging is not enabled, calls to debugout() are ignored.

Canceling Server Requests

When you execute a command that requires the debugger to make a synchronous request to the server, an animated button appears in the SAP@Web Studio’s status bar. Whenever this button is in motion, the debugger is either attempting to contact the server or waiting for a response from the server.

To cancel this operation:

  1. Click on the animated button.
  2. You see a confirmation prompt.

  3. Confirm that you want to cancel the operation.

If you choose to cancel, you should synchronize the debugger with the server, as described below.

Synchronizing the Debugger With the Server

Sometimes, you need to synchronize the debugger with the server due to an inconsistency between the debugger’s view of the program and the actual state of the program executing on the server. This does not happen often, but can occur:

For example, data packets exchanged between server and debugger can be lost.

To synchronize the debugger’s view of the current program state with the actual state of the program executing on the server as a result of either of the above scenarios, choose Debug ® Refresh State View.

 

 

Leaving content frame