Show TOC

Displaying and Changing VariablesLocate this document in the navigation structure

Context

This section briefly shows the options that you have for displaying the values of variables in the debugger.

Double-click on any variable in the editor to open it for display in the Variables view. Internal tables are automatically also opened in the ABAP Internal Table view.

Tip An another way to inspect the variable values is to hover with the mouse cursor over the variable name in the source editor in the Debug perspective.
Hover over the variable during debugging
Figure 1: Displaying variables values

Displaying Variables by Name

Alternatively, write the name of a variable in the Variables view or the name of an internal table in the ABAP Internal Table view to open the variable for display.

Displaying Hexadecimal, HTML, and XML Data

Are you confronted with unreadable hexadecimal data, or a string that contains HTML or XML tags?

Then choose Start of the navigation path Show Details As Next navigation step HTML Viewer End of the navigation path Start of the navigation path XML Viewer End of the navigation path to translate the data to text and to display the data using its HTML or XML formatting. You will find these functions in the context menu of unstructured variables in the Variables view.

Displaying variable values in HTML view
Figure 2: Changing Viewer for Details of Variables

Global and Local Variables

You may have noticed the folders Locals and Globals in the Variables view. These folders offer a fast way to find and display any active variable.

You have following possibilities:
  • Select open Locals to see a list of all of the data variables that are defined locally in the procedure that is currently executing in the debugger.
  • Select open Globals to see the globally defined data variables of the program that you are debugging.

Displaying Objects and Their Attributes

Analyzing a complex ABAP object and displaying its attributes becomes easier if you try the following:

  • Expand the size of the Variables view while you are working with the object.
  • Move a subordinate object to the top of the variables display to give yourself more display room. Choose Show as Top Level Variable from the context menu.
  • If your object attributes are internal tables, display them in the ABAP Internal Table view by putting the cursor on the table and choosing Show in Table View.

Setting Variables

Type the value that a variable should have in the Value field in the Variables view, or in any field of a structure or row of an internal table.

The variable immediately assumes the new value in the debugger context.

You can also use the Change Value entry in the context menu to set the value of a variable. The function has an added value: It is inactive if the cursor is on a variable whose value cannot be changed.

The ABAP Internal Table View

Context

Internal tables open automatically in the ABAP Internal Table view. This view lets you work comfortably with the rows in an internal table. You can quickly scroll through long tables. You can rearrange table columns for better display with drag-and-drop.

Favorite Variables (SY-SUBRC...)

Context

By default, ABAP Development Tools displays the SY-SUBRC system variable as a favorite, a variable that is automatically displayed in the Variables view.

You can add your own favorites, or even get rid of SY-SUBRC.

Procedure

  1. Type in the name of the variable in the Enter variable field in the Variables view. Or double-click on a variable in the source code that you are debugging to add it to the Variables view.
  2. Put the cursor on the variable name in the Variables view.
  3. From the context menu of the variable, choose:
    • Keep as Favorite to toggle the status of the variable - automatically displayed favorite or not.
    • Change to type in a new variable name in place of the existing variable.
    • Remove to delete the variable from the Variables view and from the list of favorite variables.