Entering content frameProcedure documentation Moving Components to Associated Classes Locate the document in its SAP Library structure

Use

Attributes, methods and events of a class can be moved to an association if required. See also: Class Diagram.

Note

The classes are associated in the defining class using an attribute with TYPE REF TO <Name_of_associated_class> .

Caution

Note that a conflict could occur if methods that you move to an associated class were already redefined in a subclass. In this case the subclass contains a syntax error.

Procedure

  1. Select the class and change to the Class Editor.
  2. Make sure you are in Change mode.
  3. Choose Utilities ® Refactoring Assistant.
  4. The Assistant is started in a separate window.

  5. Select the component to be moved and move it to the name of the associated class (in the Associations folder) using Drag & Drop.
  6. Save using the corresponding icon.
  7. Close the Assistant.

Result

The selected component is deleted from the original class and created in the associated class.

Note

This function is especially useful for splitting a class. See also: Splitting Classes

 

 

Leaving content frame