Entering content frameProcedure documentation Processing Fields Locate the document in its SAP Library structure

 

Displaying Field Values at Runtime

You can use the Fields display mode in the Debugger to display the contents of program fields. The display can accommodate up to eight fields. This is the default display mode in the Debugger. The following data objects are supported:

With more complex data objects such as references or tables, the contents are not displayed directly in the default display mode. Instead, you have to double-click the field display to call up the appropriate attribute display.

 

Procedure

  1. From any display mode in the Debugger, choose Fields.
  2. Enter a field name directly in one of the fields in the display, or select a field by double-clicking its name in the source code display. When you select a field from the source code display, the system automatically enters it in the field display.
  3. Step through the program using one of the execution types. See also Stepping Through the Source Code.

 

Example

This graphic is explained in the accompanying text

 

Displaying Further Fields

This graphic is explained in the accompanying text The field display can contain up to eight fields, of which only four can be displayed at a time. You can display the other fields by using the scroll buttons.

Displaying System Fields

This display mode allows you to display the contents of any system fields. The three most important system fields SY-SUBRC, SY-TABIX, and SY-DBCNT are always displayed.

Displaying Fields from External Programs

You can also display the contents of fields from external programs if you know the names of these. To do so, enter the program name in parentheses before the field name: fieldname(programname).

Special Types of Field Display

Changing the Display Format

You can display the field contents either formatted for their data type or in hexadecimal format.

This graphic is explained in the accompanying text  Use this button to display the field contents in hexadecimal format.

This graphic is explained in the accompanying text  Use this button to display the field contents in their original output format.

Deleting All Field Names

This graphic is explained in the accompanying text Use this button to delete all field names from the field display.

 

 

 

 

Changing Field Values at Runtime

You can change the values of fields at runtime to see how the change would affect the program flow. Suppose you have found out that a field contains an incorrect value. You would be able to replace it with another value in the Debugger to test whether the program would run properly in that case.

You can change the values of the following data objects of your program. If you enter a value with an incompatible type, the system displays an error message.

Procedure

To replace the contents of a single field, proceed as follows:

  1. Choose Fields to open the field display mode.
  2. Double-click or enter the name of a field in the source code to place it in the field display. The field name and its current value appear in the display.
  3. Enter a new value for the field.
  4. Choose the pencil icon (Change field contents) at the end of the field display.

Note

With certain data objects such as structures or internal tables, you first have to double-click the appropriate field name to display the attributes. You then have to double-click the individual fields again to open the display mode.

Result

The Debugger writes the new value to the program field and the system records the change in the system log. If you do not click the pencil icon, the changed value is ignored.

Note

The Debugger accepts the values exactly as you entered them. You must, therefore, ensure that you use the correct format (upper and lowercase, left-justified entry for hexadecimal numbers).

 

 

 

 

Leaving content frame