ERP Database - The Unofficial ERP Knowledge Base

Facebook Twitter del.icio.us Digg it
ERP Database contains a huge collection of articles related to ERP System and Software. Many of the articles are specifically related to SAP. All these ERP/SAP articles are freely available to everyone.

If you would like to submit an article or share any document related to ERP or any specific ERP software. Please mail it to support@erpdb.info. Please make sure that the documents are not copyrighted.
Social Bookmarks:

Interface

Print This Post Email This Post Written by admin on Sep 9th, 2008 | Filed under: ABAP

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:

  1. 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...
  2. 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