Processing Fields 

 

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. You can also change field values in this mode. The field display is the default display mode in the Debugger.

You can also display strings in the field display. The string display is scrollable, and you can position within it by double-clicking.

The field display also allows you to display class attributes and search for other references to the same instance. You can also find other references to a field referenced in a data reference.

 

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 described in Stepping Through the Source Code.

 

Example

Displaying Further Fields

  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 fields defined in the program, but also any system fields. The three most important system fields (SY-SUBRC, SY-TABIX, and SY-DBCNT) are always displayed at the bottom of the screen.

Displaying Fields from External Programs

You can also display the contents of fields from external programs. To do so, enter the program name in parentheses before the field name.

Changing the Display Format

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

   Use this button to display the field contents in hexadecimal format.

   Use this button to display the field contents in their original output format.

Deleting All Field Names

  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 value of any field, work area (using offset), or internal table used in a program. If you enter a value with an incompatible type, the system displays an error message.

Procedure

  1. Choose Fields to open the field display mode.
  2. Double-click 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. Click the pencil icon at the end of the field display.

Result

The Debugger writes the new value into 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.

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).