Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member566586
Active Participant
Today I randomly discovered a useful feature in ADT and wanted to share it. It should help you with debugging large internal tables.

Let's say you have a class or two.
CLASS zfh_class DEFINITION
PUBLIC FINAL.

PUBLIC SECTION.
DATA: order type i,
value type string,
inner type ref to zfh_inner_class.

METHODS constructor
IMPORTING
order TYPE i
value type string.

ENDCLASS.



CLASS zfh_class IMPLEMENTATION.

METHOD constructor.
me->order = order.
me->value = value.
me->inner = NEW zfh_inner_class( order = order + 10 value = value && `DEF` ).
ENDMETHOD.

ENDCLASS.

CLASS zfh_inner_class DEFINITION
PUBLIC FINAL.

PUBLIC SECTION.
DATA: order type i,
value type string.

METHODS constructor
IMPORTING
order TYPE i
value type string.

ENDCLASS.



CLASS zfh_inner_class IMPLEMENTATION.

METHOD constructor.
me->order = order.
me->value = value.
ENDMETHOD.

ENDCLASS.

So far, so good.

Now let's make it a table of classes.
TYPES: tt_classes TYPE STANDARD TABLE OF REF TO zfh_class.
DATA: classes TYPE tt_classes.
DO 10 TIMES.
APPEND NEW #( order = sy-tabix value = `ABC` ) TO classes.
ENDDO.

Still good.

Now let's try to inspect them in the debugger. This is what the table debugger shows by default:



The variables view has no text filter and will force you to expand everything manually:


It's in here somewhere...


The right approach is in the table debugger, which can show you the class properties using the Expand component option. It even works for nested classes!



 

I hope you've learned something new. Or possibly you're not one of today's lucky 10 000. Maybe next time!

 
1 Comment