Thursday 24 November 2016

Displaying Internal Tables in the Debugger in NetWeaver 7.0 EHP2

The New ABAP Debugger, introduced with NetWeaver 2004s, came with a Table tool for displaying the contents of internal tables.

With NetWeaver 7.0 EHP2 and with Netweaver 7.30, the Table tool has been re-worked and expanded to make it easier to use and more flexible – a truly comfortable tool for examining internal tables, no matter how large or complex they might be.
In this weblog, we’ll look at the new Table tool in the New ABAP Debugger. We’ll show you the following:
  • New and comfortable ways to change the column layout of a table so that you can see the columns you want to see
  • How to include fields from nested structures and tables and attributes of referenced objects in the display of an internal table
  • How to save the layout that you have created for a table for re-use
  • How to add or delete lines from an internal table or change the values in particular fields in a table
  • How to table layouts for re-use.
Here is a short film that shows you how to use the Table Tool:


Starting the Table Tool

Start the Table tool from the New ABAP Debugger when you need to look at the contents of an internal table while you are in the debugger:

Displaying Internal Tables in the Debugger in NetWeaver 7.0 EHP2

Arranging the Table Display and Using the Column Configurator

Most internal tables were created for reading by programs, not by people. The biggest problem in analyzing the contents of an internal table is therefore usually arranging the table display for best readability.   If you are working with a simple table, you can simply drag and drop columns to the proper positions.

If a table is wide or complex, then the Table tool offers the Column Configurator for optimizing the layout of a table. Start the Column Configurator by clicking on the Columns button.

Displaying Internal Tables in the Debugger in NetWeaver 7.0 EHP2

In the Column Configurator, you can move columns around, delete columns that you do not need, and mark object attributes or fields in nested structures or internal tables for display in the table tool.

Displaying Internal Tables in the Debugger in NetWeaver 7.0 EHP2

Displaying Object Attributes and Fields in Nested Data Objects

As the screen shot above suggests, you can add data entities from nested objects to the Table Tool display.  Before NetWeaver 7.0 EHP2, you needed to click your way into the object or nested data structure in each row of an internal table in order to see the data.

With the new Column Configurator, you can have the data pulled up into the normal table display. Here in more detail is how to display concealed data:

1. You start in the Table tool in the New ABAP Debugger with a table like this one, which contains references to instances of ABAP Objects classes. You want to see the customer address information that is hidden in the objects.

Displaying Internal Tables in the Debugger in NetWeaver 7.0 EHP2

2. Click on the Columns button. In the Column Configurator, the Insert Subcomponents icon marks columns that contain data objects with nested attributes or fields.  In this case the CUSTOMER (references to instances of ABAP class CUSTOMER) and DREF columns (anonymous data references) contain such objects.Clicking on Insert Subcomponents at the CUSTOMER column opens a list of the attributes of the CUSTOMER class. We select all three for inclusion in the column configuration.

Displaying Internal Tables in the Debugger in NetWeaver 7.0 EHP2
3. The Columns Configurator recognizes recursive data objects. The ACCOUNT, ADDRESS, and ID subcomponents have all been added to the column configuration.  ADDRESS itself contains further subcomponents that we want to add to the display.

Displaying Internal Tables in the Debugger in NetWeaver 7.0 EHP2

4. We move the ADDRESS subcomponents to the front of the layout in the Column Configurator for easier viewing.

Displaying Internal Tables in the Debugger in NetWeaver 7.0 EHP2

5. When we press the Apply button at the bottom of the Column Configurator, the hidden class attributes are added to the Table display for all of the rows of the table. There is no need to drill down into each separate class object to view the data.

Displaying Internal Tables in the Debugger in NetWeaver 7.0 EHP2

Saving a Table Layout for Re-Use

So that you do not need to adjust a table’s layout each time you start the debugger, you can save a table layout.  You can also apply it automatically to other tables that have the same type definition.

Saving a layout affects only your view of a table – you do not affect other users who might need to analyze the same table.

Sharing a Table Layout

You want to share your great layout for an important table with someone else?  No problem.  Just do the following:
  • Open the Column Configurator.
  • Mark the columns in the Configurator that make up the layout to share (most likely, you will simply want to mark all entries).
  • Copy the marked fields to the clipboard with Ctrl-C or the context menu.
  • Paste the clipboard contents into a mail or .txt file for your colleague.
  • To apply the layout, your colleague simply copies and pastes the column layout into the column configurator in their own debugger session.
Displaying Internal Tables in the Debugger in NetWeaver 7.0 EHP2

Adding or Deleting Table Rows or Changing Values


Modifying a table or the values in table fields has also been made easier. To delete rows, for example, just mark the rows to be discarded and open the context menu with a right mouse click.

Displaying Internal Tables in the Debugger in NetWeaver 7.0 EHP2

Even More Table Services…


To see the full range of operations that you can perform on a table, just click on the Services of the Tool button at the right of the Tables workspace. Among other convenient functions for displaying the contents of internal tables, you find things like Position on Column, which moves the column that you mark to the left-most position in the display or Optimize Column Width, which performs an Excel- or OpenOffice-Calc-like adjustment of the column widths for best display.


Displaying Internal Tables in the Debugger in NetWeaver 7.0 EHP2

No comments:

Post a Comment