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).