Testing Function Modules 

Debugger

You should use the test environment in the Function Builder to test new function modules before releasing them for general use. You can also use the test environment to examine functions written by other developers before calling these modules from within your own programs. The library's testing options let you determine if a function performs as it should and shows you if the module returns expected results. To run a test:

  1. Choose Test from the Function Builder initial screen.
  2. The Test Function Module screen appears. It displays all of the import and changing parameters of the function module.

  3. Specify the data you want to transfer from your program to the function module.
  4. Fill in values for the relevant import, changing, and tables parameters. To fill in single-field parameters, enter the value in the displayed field. To fill in table/ structure parameters, double-click on the parameter name.

  5. Choose Execute.

The system runs the function module using your input and displays the values of the export parameters that result:

When you test a function module, the system displays any exceptions. The system also identifies the time required to execute the module in microseconds. This is an elapsed-time measurement. The measurement includes interrupt time as well as processing time. You should view this elapsed-time as an estimate only.

Other Test Options

The Function Builder contains more test options than simply running a function module. You can also run a test in the debugger or create a runtime analysis performance file for a function. To investigate a function module in debugging mode:

  1. Choose Test from the Function Builder initial screen.
  2. Specify the data you want to transfer from your program to the function module.
  3. Select Debugging.

The system executes the function module in debugging mode. You can step through the function's code and use all the options offered within the Debugger

To test a function module's performance, select Runtime analysis (Transaction SE30) from the Test Environment for Function Modules screen. The system executes the function module and records the function's performance in a special performance data file. Select Eval.rtime analysis to display the results of the analysis.