Show TOC

Where to Implement Test ClassesLocate this document in the navigation structure

Context

Depending on the program object with which you are working, there are different recommendations as to where you should implement ABAP Unit test classes. In classes, for example, there is a special include for ABAP Unit test classes. Function modules also provide a special include for ABAP Unit tests.

This table shows you how ABAP Development Tools supports you in creating and navigating to these ABAP Unit includes, where available, and where to write your ABAP Unit source code.

Type of Repository Object Where to Write Your ABAP Unit Test Classes
ABAP Classes Just choose the Test Classes tab at the bottom of the ABAP class editor.

ABAP Development Tools creates the include for ABAP Unit tests automatically, and you can program your ABAP Unit test classes here.

ABAP Function Modules Create the ‘T99’ include for ABAP Unit classes from the embedded Java GUI or SAP GUI:
  1. Open the function group in the ABAP Object Navigator (transaction SE80).
  2. Open the context menu of the function group and choose Start of the navigation path Create Next navigation step Other objects Next navigation step Generate test class End of the navigation path.
  3. Follow the instructions provided by the ABAP Unit wizard.

Result

The <function_group_name>T99 include is created for ABAP Unit test classes. The wizard also generates stubs for the test methods that you specify.

In ADT, you can navigate to the ‘T99’ include and edit the ABAP Unit classes by opening the function group from the Project Explorer. That opens the master program of the function group. You can then navigate to the ABAP Unit source code in the T99 include.

ABAP Programs, Reports, and Subroutine Pools Create ABAP Unit local classes and test methods at the end of the ABAP program.

There is currently no separate ABAP include in ABAP programs and reports for ABAP Unit tests.