Interfaces are extensions to class definitions and provide a uniform point of contact for objects. In contrast to classes, instances cannot be created from interfaces. Instead, classes implement interfaces by implementing all of their methods. You can then address them using either class references or interface references.
Different classes can implement the same interface in different ways by implementing the methods differently. Interfaces thus form the basis for polymorphism in ABAP Objects.
Prerequisites
Both the defining class and the interface were already created in the Class Builder.
Procedure
You can assign attribute
If an interface attribute was included in the class, you can assign the initial value to the attribute in the attribute display of the enhanced class.
Result
You enhanced the components of the class with interfaces. The interfaces that were added are listed in the definition part of the class following the INTERFACES statement in the class pool.
The methods listed in the interface definition can only be implemented within the class if they did not mark the interface as Abstract. The components defined in the interface (attributes, methods, and events) appear in the class in the from <interface name>~<component name>. This ensures that no naming conflicts can occur with class components.
You can assign all the components of the interfaces alias names as an abbreviation for the full name. To do so, click on Aliases and enter the alias name. In addition to the name, you can also define the visibility
See also:
Implementing Methods Creating Subclasses Nesting Interfaces