Interface Concept in Object Oriented ABAP

Interfaces in SAP Classes, using interface concept with SAP Object Oriented ABAP programming.

A+ A-

Before going to interfaces, we must know about Polymorphism .

What is Polymorphism in Object Oriented Programming model ?

It is a concept by which the same method names will behave differently in different classes i.e each method will have its own implementation in different different classes but with the same name.

Interface is one of the concept in Object Oriented ABAP to achieve Polymorphism.

What is an interface in Object Oriented ABAP ?

  • Interfaces are independent structure which are used in a class to extend the functionality of a class.
  • Interfaces contains methods without any implementation. Where as a class contains methods with implementation.
  • We need to define an interface with the required method names in SE24 TCODE.
  • The interfaces can be used by no of classes to extend the functionality of the class.
  • To implement an interface in a class just give the name of interface under the 'Interfaces' tab.
  • All the interface methods will be automatically copied to the classes in a particular class without effecting the other classes.
  • The main use of interfaces is re-usability and maintain standard project framework.

Interfaces in SAP Classes

In the above diagram, application is business application, Class A, Class B, Class C, Class D and Class E are independent classes, all these classes are using one Interface called Interface( in diagram).

In all the classes,the methods names are same but the implementation will be different from one class to another class thereby achieving the concept called POLYMORPHISM. Polymorphism is implemented in the from of interface.

Learner Questions

No Questions by learners, be first one to ask ..!!

    Please Sign in to ask a question

    Was this lesson helpful to you? Yes No 104 People out of 107 think this lesson helpful

    Lesson Navigation

    Constructors in SAP OOABAP ← Previous Lesson
    Next Chapter →