Entering content frameProcedure documentation Testing Methods  Locate the document in its SAP Library structure

You can test access to methods of a class using a test object. If the method has no export parameters, the system does not display a result screen.

Prerequisites

You must have instantiated the class you want to test (see Creating an instance).

Procedure

  1. In the Methods branch of the object display, select the method you want to execute.
    This graphic is explained in the accompanying text
  2. Click the Execute icon to execute the method.
    The appearance of the next screen depends on the method parameter definitions:
    a).
    If the method has import parameters, they are displayed, and you can assign new values to them. The system automatically checks their type.
    Then choose Execute.
    If your entries do not contain errors, the method is called using the parameters you specified.
    You can also execute the method in debugging mode by choosing Debugging.

    This graphic is explained in the accompanying text
    b).
    For any other parameters, the method is called directly, and a result screen appears, containing the runtime.

Note

You can debug methods that do not have import parameters by choosing Utilities ® Debugging ® Switch on debugging.

Result

You have now used a test object to test the CALL METHOD statement for a class method.

Note

If the method triggers an exception during the test, the system displays a dialog box containing the exception name and message text.

 

 

 

 

Leaving content frame