Abstract Class in SAP ABAP

Abstract class in SAP ABAP is a special type of class, which can not be instantiated, which means we can not create objects of that class. it needs to be subclassed by another class to use its properties. An abstract class can include one or more abstract methods, which are method declarations without an implementation. When a class inherits from an abstract class, it is required to provide implementations for all the abstract methods declared in the abstract class.

Example:

CLASS abstract_class DEFINITION ABSTRACT.
PUBLIC SECTION.
METHODS: abstract_method ABSTRACT.
ENDCLASS.

CLASS abstract_class IMPLEMENTATION.
METHOD abstract_method.
* Implementation of the abstract method goes here
ENDMETHOD.
ENDCLASS.


Abstract Class Vs Interface in SAP ABAP

In this article, we are going to learn the difference between an Abstract Class and an Interface in SAP ABAP. It is created by SAP which is a domain-specific language, it is 4th generation programming language. It is also called ABAP/4(Fourth Generation Language” or 4GL).

Abstract Class Vs Interface in SAP ABAP

Similar Reads

Abstract Class in SAP ABAP

Abstract class in SAP ABAP is a special type of class, which can not be instantiated, which means we can not create objects of that class. it needs to be subclassed by another class to use its properties. An abstract class can include one or more abstract methods, which are method declarations without an implementation. When a class inherits from an abstract class, it is required to provide implementations for all the abstract methods declared in the abstract class....

Interface in SAP ABAP

The interface in SAP ABAP is different from the class, it can not have any implementation like the class. It defines a set of method declarations that a class must implement without providing any implementation detail of that method. Interface helps in achieving multiple inheritance. Multiple inheritance can be defined as a class can inherit multiple interfaces. Due to Inheritance interface provides a base for polymorphism because the method declared in the interface behaves differently in different classes. Like class Interface can be defined locally or globally in the ABAP programming language....

Difference between Interface and Abstract class in SAP ABAP:

Here we are providing you a list of difference between Abstract class and Interface in SAP ABAP:...