Interface
An Interface is a declaration of a set of Methods with no information given about the implementation of those methods. Interfaces are used to define common functionality that can be used by different classes. Interfaces are implemented in classes by listing the interface name in the definition part of the class.
CLASS customer DEFINITION.
Public Section.
INTERFACES <interface_name>.
ENDCLASS.
An interface can be implemented publicly. The methods defined in the interface are implemented in the class. All methods that are defined in the interfaces must be present in the implementing class.
Much like a class, an interface defines methods. However, unlike a class, an interface never implements methods; instead, classes that implement the interface provide the implementation to the methods defined by the interface.
An interface can be accessed using an object reference as long as that objects class implements the interface. This is done using the interface resolution operator ‘~’:
<object_name>-><interface_name>~<method_name>.
If you like this post, you may as well like these too:
- ABAP Programs: Using interface parameters of a form REPORT ZSOURCE1004* Types and data for later useTYPES: T_NAME(20).DATA: NAME_1 TYPE T_NAME VALUE ‘A’, NAME_2 TYPE T_NAME VALUE ‘B’.* Calling a form with different parametersPERFORM SET_NAME CHANGING NAME_1.PERFORM SET_NAME CHANGING...
- Online Interface between Java and SAP Procurement & Material Management System (MATS) is a custom solution based on J2EE framework implemented for a leading automotive manufacturing company for at all its plants to improve the efficiency...



















Leave a Reply