Creating Instances 

You instantiate a class using the ABAP statement CREATE OBJECT. This calls the constructor for the instance. The constructor can contain parameters that you may have to supply with values.

In the test environment, the system automatically instantiates classes that have no static attributes or methods.

Prerequisites

You must have started the test environment.

Procedure

  1. Choose Instance.
    If the relevant constructor has parameters, a dialog box appears.
  2. Enter valid values for the constructor parameters.

    Example:
  3. To create an instance, choose Instance.

Result

You have now created an instance (test object) for the class you want to test. Test object -> appears in the first line. The object ID is displayed next to the class name.

Example: