2017 we have introduced an open source helper for creating abapUnit tests.
More precisely this helper will help you preparing test data for abapUnit tests.
Today we will talk about some updates of this project.
During the last year a lot of things has been changed in the implementation through continuous refactoring. While focusing on single responsibility principle, the class count but also readability and reusability was increased.
For a better support of internal tables and structures the integration into SAPs ABAP debugger framework has been revised. This was a good opportunity to learn more about ABAP asXML Format. The new way of this integration was needed for example to get all the information and not just a top level data of an internal table. Given this data it is possible to mix up internal table and structure representation. Read on for more information about this feature.
One main goal was to introduce loose coupling between formatting (pretty print) a value #() statement with spaces, tabs and line breaks and a syntax correct representation of it. Formatting the value #() statement pushed us to the limits of ABAP RegEx possibilities. Due to a missing support of look-behinds in ABAP (respectively POSIX) an exclusive formatting using RegEx was not possible. But we found a new approach using possibilities of class CL_ABAP_STRING_C_READER for achieving this goal.
One positive side effect of a decoupled pretty print feature is resulting in much simpler unit tests of this enhancement.
Also in the new version, the prompt for max line length is gone. Now we introduced here a possibility to provide your own value #() statement pretty printer. Therefore you will need to provide an implementation of Interface ZIF_OP_VALUE_PRETTY_PRINTER. Furthermore this new class must be assigned to a user using table ZTOP_DVE_CUST. Otherwise supplied default implementation ZCL_OP_VALUE_PRETTY_PRINTER will be used for pretty printing.
Another change, like mentioned above, affects presentation of complex data structures (internal tables in internal tables, internal tables in structures etc.). Due to a new asXML integration it is now possible to create following representations directly from your debugging session.
Structure with an internal table in it:
Internal table with internal table in it
We hope you will find this tool helpful.
As we use the new VALUE operator, the minimum ABAP version you need is a 7.40.
How to install to your system
Here you will find all the needed coding:
Please use abapGit to get this coding to your system.
Pull Requests (and Issues) on GitHub are welcome.