An interface in ABAP defines a contract that any implementing class must follow. It contains only declarations of: Methods (without implementation) Constants Types Attributes Interfaces do not contain implementation. Any class that implements an interface must provide the logic for all its methods. Feature Description No implementation Only method ...
SAP EWM Help Latest Questions
An abstract class is a class that cannot be instantiated directly. It serves as a blueprint for other classes. Abstract classes typically include: Abstract methods, which are declared but not implemented. Concrete methods, which can be implemented and inherited. Feature Description Not instantiable Cannot use CREATE ...
A constructor is a special method automatically called when an object is created using CREATE OBJECT or NEW. Types of Constructors in ABAP Type Method Name Called On Purpose Instance Constructor CONSTRUCTOR When an ...
A Singleton class is a design pattern that restricts the instantiation of a class to one single object throughout the lifecycle of a program. This is useful when exactly one object is needed to coordinate actions across the system — such as logging, configuration ...
Polymorphism allows different classes to be treated through a common parent reference, while still calling their own version of a method at runtime. When to use it: When you want to treat multiple objects generically, but still get their specific behavior. In ...
Instance Members (Methods & Data) Belong to individual objects (instances). Created using DATA and METHODS. Each object has its own copy of the data. Accessed using the object reference: lo_obj->method_name. Useful when each object should maintain its own state. Destroyed when the object goes out of ...
Method overriding allows a subclass to provide a new implementation of a method that is already defined in the superclass. The method in the subclass must use the REDEFINITION keyword. When to use it: When a general method in a ...
A final class is declared using the keyword FINAL in its definition. It’s used when you want to prevent further inheritance of the class, ensuring its behavior cannot be modified through subclassing. Why Use a Final Class?
When we create a variable in the public section of a class, we can use it within the methods of that class. Let’s say we assign it an initial value. Later, if we create another variable with the same name ...