Mentor SAP

Generation of UML Diagrams for Global Classes

In SAP NetWeaver 7.0 Enhancement Package 2 (EhP2), the Class Builder can generate UML diagrams for existing coding. This function will display global classes if you select a package to display. If however, you select a program, local classes and global interfaces will be displayed, but not the global classes. However, the diagrams can include objects from ABAP Dictionary.

 

The figure shows how to start the functionality for a complete package. In a dialog box, you can add a selection of objects and specify which details you want to see on the diagram.

 

 

Inheritance in Global Classes

Set out the inheritance relationships between global classes on the Properties tab page.

 

Choose the Superclass button to specify a superclass. In the example shown in the figure, the subclass ZCL_CARGO_PLANE_00 inherits from superclass ZCL_AIRPLANE_00.

 

 

Redefinition of a Method in Global Class

To redefine an inherited method, select the relevant method in the list and choose the Redefine button. Alternatively, you can use the context menu in the navigation area.

 

The appearance of some of the buttons or menus depends on the release level. The button for redefining methods is one example.

 

Hint: To define the constructor in the subclass, choose the CONSTRUCTOR button in the application toolbar. The system then proposes transferring the signature of the superclass constructor. This is helpful when you want to create the subclass constructor. You can add some parameters here. Similarly, you can find the call for the superclass here.

 

 

 Local Types in Global Classes

There are two class includes for definition and implementation of local classes, as follows:

  1. Local Definitions/Implementations (formerly: Local Class Implementations):
    This include contains local interfaces, local class definitions, local types, and local class implementations that are not used in the private section of the global class (for example, for typing a method parameter).
  2. Class Relevant Local Definitions (formerly: Local Types)
    This include contains local interfaces, local class definitions, local types, and local class implementations that are used in the private section of the global class (for example, for typing a method parameter).

The includes can be entered by the menu GotoLocal Definitions/Implementations.

 

You can define local types in global classes. Global classes include local classes.

 

Technically, you are not defining a class within a class, but a class that is local in the repository object of the global class.

 

All components of the global class have access to these local types, but they are encapsulated if you try to access them from outside.

 

The same applies for local interfaces in global classes.

 

Class Component Display

To improve your understanding of inheritance and interface components, you can set the Group by Classes and Interfaces flag in the User-Specific Settings for the Class Builder. The system will then display the components of the global class in a group.

 

Sorting the Component Display of Global Classes

You can sort all components by five criteria in three levels. Choose the Sort pushbutton to display the appropriate dialog box.