Mentor SAP
Print or MethodPrint to print selected portions of the source text.

 

Class Builder Testing Environment

You can test active global classes by choosing menu path ClassRunIn Test Environment, choosing the corresponding application toolbar button, or press F8.

 

Static attributes and static methods are directly accessible in the test environment. Instance attributes and instance methods are accessible after instance creation only. You can create an instance using the Create Instance button.

 

The system only lists the public components. Methods can be tested using the Execute Method button.

 

The following are the steps to trigger events in a class:

  1. Select an event.
  2. Choose Handler to register a standard method for the event.
  3. Call a method in which the event trigger was implemented.

The event that was triggered and all of the exported actual parameters are displayed in a list.

 

 

Use of Global Classes in the ABAP Editor

Like other repository objects, global classes, and interfaces are added in the navigation area of the object navigator. This way, the discussed advantages also apply to global classes and interfaces.

 

 

Object Instantiation Using Drag and Drop

In the navigation area, select a class name and move it to the editing area. This action creates a CREATE OBJECT statement. Then, add the reference variable and the actual parameters, if applicable, to the statement.

 

Alternatively, you can also choose the Pattern button. You can find the CREATE OBJECT statement by selecting ABAP Objects Patterns. You can generate the statement using the input help.

 

 

Method Calls Using Drag and Drop

In the navigation area, select a method name and move it to the editing area. This action creates a CREATE METHOD statement. Then, add the reference variable and the actual parameters, if applicable, to the statement.

 

Alternatively, you can also choose the Pattern button. The CALL METHOD statement is under ABAP Objects Pattern. You can generate the statement using the input help.

 

Note: To generate patterns, enable the modern functional writing style for method calls. Choose UtilitiesSettingsPattern and select the Functional Writing Style for Call Method checkbox.