Processing Internal Tables 

 

Displaying Internal Tables

You can display and change the contents of internal tables (including nested tables) at runtime in the Debugger. The Debugger also provides information about the table type, table key, and the amount of memory it requires.

Procedure

  1. Choose Goto ® Table or the Table pushbutton from any other display mode. The table display appears.
  2. Enter the name of an internal table in the Internal table field, or select a table by double-clicking its name in the source code.
  3. Choose ENTER to confirm.
  4. Step through the program using one of the four possible execution types.

Example

Header Line

  If the internal table has a header line, it is indicated by this icon. If you double-click the icon, the system opens the Structured field display. This contains the names of the components, their current values, and also their technical attributes.

Scrolling Vertically

The table lines are numbered. The first column of the header is an input field in which you can enter the number of the line you want to appear at the top of the display.

You can also scroll using the scroll icons in the standard toolbar.

Scrolling Horizontally

  You can use the scroll buttons to scroll through the table horizontally. If the table is too wide for all of it to be displayed, use the scroll keys, or move the column headers.

Moving Column Headers

You can change the order in which fields are displayed in the internal table display. To do so, overwrite the text in the field name list with the field names in the order in which you want them to appear. To remove a field from the display, delete its field name from the header. If you enter the name incorrectly, the system displays a sequence of question marks.

If there is not enough room to display the entire field, the system shortens the field and displays the "<" character to inform you.

Shifting a Column to the Left

If you double-click a column heading, the table display shifts to the left. None of the columns to the left of the selected column heading are then visible. However, you can restore them to the display by scrolling horizontally.

Specifying a Table Type

Next to the table name, the Type field contains the table type. This may be standard, hashed, or sorted.

Changing the Display Format

Similarly to the field display, you can change the display format in the internal table display mode. The Format field usually contains the value E (for display in columns with relevant formatting). However, it can also take the value X (hexadecimal display), or C (character display).

Resizing the Table Extract

  Click this button to increase the size of the table extract that is displayed. Three lines of ABAP source code are displayed, and the rest of the screen is used to display lines of the internal table.

  Click this button to reduce the table display to five lines. The rest of the screen is used to display the ABAP program code.

Displaying Memory Use

To find out how much memory the internal table occupies, choose Goto ® Display condition ® Memory usage.

 

 

 

 

Changing Internal Tables

You can change the contents of internal tables in the Debugger at runtime. You can delete, edit, or add table lines.

Deleting Lines

To delete a line from an internal table:

  1. Open the internal table display mode.
  2. In the Internal table field, enter the name of the table.
  3. Choose ENTER .
  4. The system displays the contents of the table.

  5. Position the cursor on the line that you want to delete.
  6. Choose Delete.

The line is removed from the table, and the system automatically corrects the line numbering.

Changing Lines

The Change, Insert, and Append functions are field-specific, and can only be used for a single field at a time. Suppose you want to edit the following line:

LH001 FRANKFURT NEW YORK 145400 400 X

First, you have to decide which field you want to edit. Then:

  1. Position the cursor on the relevant field in the line that you want to edit.
  2. Choose Change.
  3. The field appears in input mode.

  4. Enter a new value for the field.
  5. Choose ENTER .

The system updates the line and displays the changed contents in the table.

Inserting Lines

The Insert and Append functions allow you to add a new line to an internal table. If you choose Append, the new line is added to the end of the table. If you choose Insert, you can add the new line at any position in the table. To insert a new line at the end of the table:

  1. Choose Append.
  2. Enter a value for the first field of the line.
  3. Choose ENTER .
  4. The system adds a new line to the end of the table, containing the value that you entered for the first field.

  5. Enter values in the remaining fields as described above.

If you want to add a line in the middle of the internal table, place the cursor on the line before which you want to insert it. Choose Insert, then follow the procedure described above from step 2.