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:
- Redefined Method A Redefined method is a method in a subclass that provides a new definition of an inherited method from a super class in order to provide a more specialized...
- Object Oriented Programming in SAP ABAP Object Oriented Programming in SAP ABAP Object oriented programming tries to map the real world objects with their attributes and methods as realistically as possible in program constructs. The...
- SAP ABAP Idoc Interface Download here ...
- What is BADI? BADI stands for Business Add-in. BADI’s are an enhancement concept which uses ABAP objects. Totally a object oriented method to enhance classes, interfaces, methods. You need to first define...
- 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...

















Leave a Reply