I was recently debugging a sales order user exit and wanted to see data present in all the internal tables at that point.
Since all internal tables had header line, their records count was not visible in Variable Fast Display of New Debugger.
As a result, it was inconvenient to double click on 226 internal tables only to find that most of them are empty.
This blog will cover:
- How to filter the internal tables’ names from a huge list of variables in New Debugger.
- How to easily see the record count of a given list of internal tables (esp. the ones with header line)
A breakpoint is set in USEREXIT_READ_DOCUMENT of program MV45AFZZ and a sales order is displayed.
Navigate to Variable Fast Display > Globals tab in New Debugger.
The table icon in second column indicates that it is internal table.
We can’t know whether the table has any record by just looking at Globals tab.
To see the number of records, we need to suffix the internal table names with .
Entering the names manually is time consuming, adding the suffix is even more time consuming.
Filtering internal tables from global variables list
We can first sort the globals list so that all internal tables are together.
There is no sort button visible, but it can be done by clicking on settings button on right side.
Select the second column, click on settings and do sort.
The sorted list now shows 20+ items at a time.
Since there were 226 internal tables, Block selection (Ctrl+Y) and PageDown cycle wasn’t so good to copy the names.
So, I used same settings button again to save the list to local spreadsheet.
We now have the list of internal tables, but they need to be suffixed with .
Adding suffix to a list
I used Notepad++ to select every line using (.*) and regex replaced it with \1 to add  to all names.
However, MS Excel can also be used to do it easily using concatenation.
Just like ABAP has concatenate and && operator, MS Excel has & operator to join values.
Below screenshot shows the formula used to add suffix. Column A has the list, Column B has .
Column C has formula =A[RowNumber]&B[RowNumber].
If I didn’t know concatenation operator, I would have pasted Column A and B to Notepad and replaced TAB character with nothing.
Variables 1 tab will be able to show records for this data.
Unfortunately “paste from clipboard” option is not present in Variables 1 tab.
The visible area allows me to display only 25 variables at once.
I copied the suffixed names in batches of 25 to see the records.
This method may seem lengthy, but it is better than double-clicking on 226 internal table names.