OOP ABAP Interview Questions can become challenging when the interviewer moves beyond basic definitions and starts asking about real-world scenarios.
You may know what encapsulation, inheritance, polymorphism, interfaces, constructors, and Factory patterns mean. However, the interview can quickly become more difficult when you need to write an example, explain your design choice, or adapt an OOP solution to an S/4HANA scenario. That is where memorized answers often fall apart.
This guide takes a practical approach to OOP ABAP interview questions. Instead of treating ABAP Objects as a list of definitions, it moves from core syntax to design decisions, working code, exception handling, interfaces, design patterns, AMDP, and modern S/4HANA considerations. The goal is simple: help you explain not only what an OOP concept does, but also when and why you would use it in a real ABAP development scenario.
How We Organized These OOP ABAP Interview Question
Each level below represents what interviewers will ask at that experience level and not simply the difficulty of the topic. The basic questions are based on the ability to read and write a class. Intermediate and advanced questions involve reasoning about design tradeoffs and about the behavior of S/4HANA.

Basic OOP ABAP Interview Questions
Every list of OOP ABAP interview questions starts here with core concepts like classes, objects, and encapsulation
1. Object Oriented Programming (OOP) in ABAP?
In ABAP, OOP represents a program as a collection of objects, which contain both data (attributes) and behaviour (methods), rather than as a set of data structures and a set of routines. Features a class-based, object-oriented approach to the replacement of the older procedural style of FORM/PERFORM, inheritance, and polymorphism.
2. What is meant by local class in ABAP?
Implement CLASS … DEFINITION with sections for visibility, then implement individually:
CLASS lcl_employee DEFINITION.
PUBLIC SECTION.
METHODS: display_name.
PRIVATE SECTION.
mv_name is a string data type.
ENDCLASS.
CLASS lcl_employee IMPLEMENTATION.
METHOD display_name.
Reads the private attribute and writes it out
WRITE: / mv_name.
ENDMETHOD.
ENDCLASS.
3. How many parts are there in the class that a student can see?
PUBLIC SECTION: anyone can call; PROTECTED SECTION: Anyone can call within the class & subclasses. PRIVATE SECTION only those inside the class themselves can call. ABAP enforces encapsulation in this way.
4. What is the difference between class and object?
A class is a blueprint, a type definition, attributes, and methods. Objects are instances of those classes in memory, created by CREATE OBJECT or the NEW operator, with their own copy of the instance attributes.
5. What is encapsulation, and why is it important?
Encapsulation makes an object’s internal state inaccessible to its callers, thereby preventing them from altering the data directly or making assumptions about its internal structure. This allows for updating internal logic without breaking all callers.
6. What is inheritance?
To inherit from a superclass, developers create a subclass using INHERITING FROM. The subclass reuses part of the superclass logic and can also override some of its methods. Single inheritance: ABAP Objects only supports a single superclass for a class.
7. Polymorphism and its difference from overloading?
Polymorphism allows a superclass or interface reference to point to different concrete objects. When you call a redefined instance method, ABAP resolves the call according to the object’s runtime type. In ABAP Objects, developers commonly implement polymorphism through inheritance and interfaces.
ABAP does not support conventional methods where multiple methods in the same class share a name but have different parameter signatures.
8. A constructor is a method that is automatically called when an instance of a class is created.
All other methods are called after the instance constructor, and the instance constructor is called automatically. Every time an instance of the class is created using the CREATE OBJECT or NEW statement. Use it to set up mandatory attributes or validate required input parameters.
9. What are the difference between an instance constructor and a static constructor (CLASS_CONSTRUCTOR)?
The instance constructor is called exactly once when an object is created and can accept input parameters. The static constructor is called automatically, once and only once per class per internal session, without any arguments and is used for initializing static (class-level) data.
10. What is a local class vs. a global class?
Local classes are only defined within the program in which they are created (in the ABAP Editor or ABAP Development) and are not “global.” Global classes are built with SE24/Class Builder or ADT, saved in the class pool, and can be used throughout the system.
Intermediate OOP ABAP Interview Questions
11. What is the difference between CREATE OBJECT and the NEW operator?
Both create an object, but NEW (from ABAP 7.40) is an inline constructor expression, which allows you to create and instantiate an object in one statement without using a DATA line.
” Old way
In this case, the field DATA lo_emp is type REF of a type lcl_employee.
CREATE OBJECT lo_emp.
Instantiates an inline “declares” statement.”7.40+ way — declares/instantiates”
DATA(lo_emp_new) = NEW lcl_employee( ).
If you are using an ECC system with a value less than 7.40, you cannot use NEW, because it is not supported.
12. What is an interface, and how does it differ from an abstract class?
An interface defines a contract that a class agrees to implement. It can contain components such as methods, attributes, events, and constants, but the implementation of its interface methods is provided by the implementing class. An abstract class can contain implemented methods, abstract methods, and state, while an interface is primarily used to define a contract that can be implemented by multiple classes.
13. Is it possible to have more than one interface implemented by a class?
ABAP does not support multiple inheritance between classes. A class has one direct superclass, but it can implement multiple interfaces. Therefore, interfaces provide a way for one class to satisfy multiple contracts without multiple class inheritance.
14. What is meant by method redefinition?
REDEFINITION – Overrides an inherited public/protected method with a new implementation in the same method list with the same signature. Static methods, private methods and attributes cannot be redefined.
15. On a class or method, what is the meaning of FINAL?
It is not possible to inherit a FINAL class, or to redefine a FINAL method in any subclass. Apply it in cases where the design is not supposed to be extended further, such as a utility class that does not have any variants.
16. A singleton class is a class whose constructor can only be called once.
A singleton class restricts a class to one instance per internal session. Developers typically control instance creation through a private or restricted constructor and a static method that returns the existing instance. This pattern works well for shared resources such as loggers, connection handlers, or caches. In real-world ABAP applications, developers may use singleton patterns when they need controlled access to shared state or a centralized service.
CLASS zcl_logger DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
CLASS-METHODS get_instance
RETURNING VALUE(ro_instance) TYPE REF TO zcl_logger.
PRIVATE SECTION.
CLASS-DATA go_instance TYPE REF OF zcl_logger.
ENDCLASS.
CLASS zcl_logger IMPLEMENTATION.
METHOD get_instance.
> Only creates the object the first time it is called for.
If the instance is not bound.
go_instance = NEW zcl_logger( ).
ENDIF.
ro_instance = go_instance.
ENDMETHOD.
ENDCLASS.
Make private create objects – all calls must go through get_instance.
17. What is meant by “casting,” and what is the difference between narrowing and widening casts?
Widening (up-cast): An automatic widening of an object reference in a runtime polymorphic manner from a specific type to a more general type, such as a superclass or interface reference. Narrowing (down-cast) is a general operation that is made more specific by adding an explicit CAST operator or the ?= operator, and may throw an exception at runtime if the object is not of that specific type.
18. A class exception is what? How do you make it?
Class-based exception extensions of CX_STATIC_CHECK, CX_DYNAMIC_CHECK or CX_NO_CHECK. They change the old MESSAGE … RAISING model to a structured, inherited error object model.
TRY.
Raised when the input value is invalid.Raised if the input value is invalid.
EXPORTING textid = zcx_invalid_input=>empty_field.
If the input is invalid, then send it back into DATA(lx_error).
” Get the structured error in the form of lx_error->get_text( )
WRITE: / lx_error->get_text( ).
ENDTRY.
19. ABAP Objects have what kind of events?
An event is a signal that a class declares with the EVENTS statement. The class can trigger the event using RAISE EVENT any object that registers an event handler can respond by executing a method defined with FOR EVENT. This approach separates the object that triggers the event from the objects that respond to it.
20. What is a friend class?
A FRIENDS declaration allows another class or interface to access a class’s protected and private members without making those members publicly visible Use it sparingly, that is, only in tightly coupled helper classes, as it is not a good practice to increase coupling.
21. Is it possible to create an object of an interface directly?
No, you cannot use CREATE OBJECT with an interface type because the interface does not provide an implementation. Instead, instantiate the implementing class and use its object through the interface reference when needed.
22. What is the difference between static and instance components?
A static (CLASS-DATA, CLASS-METHODS) component is part of the class, and is shared by all instances and all subclasses. Each instance (DATA, METHODS) component is independent of each other object.
| Interview scenario | Prefer | Why |
|---|---|---|
| Several unrelated classes must satisfy the same contract. | Interface | Supports multiple contracts without multiple class inheritance |
| Related classes share behaviour and state | Abstract class | Reuses common implementation |
| Behavior varies by concrete object. | Polymorphism | Keeps calling code independent of implementation |
| Object creation depends on runtime conditions | Factory | Separates creation logic from business logic |
| A class must restrict instance creation | Singleton/factory approach | Controls access to object creation |
| Business logic needs isolated dependencies | Interface + dependency injection | Improves testability |
| Database-heavy HANA processing has a justified pushdown requirement | AMDP, where applicable | Moves suitable logic to the database |
| New transactional service/application development | RAP/CDS, where applicable | Aligns with modern S/4HANA development models |
Advanced OOP ABAP Interview questions
These OOP ABAP interview questions are the ones senior interviewers use to separate candidates who’ve memorized syntax from those who’ve actually designed systems.
23. What is the difference between S/4 HANA and OOP ABAP and ECC?
Based upon this classic ABAP Objects model, S/4HANA extends OOP design by introducing RAP (RESTful ABAP Programming Model), CDS (Core Data Services)-based business objects, and pushed-down logic via AMDP (ABAP Modular Programming Model). ECC code still heavily uses old-style BAdIs and function-module wrappers for OOP logic.
In R/3, the model was extensive and required extensive development and testing. In R/3, the model was large and needed extensive development and test.
24. What is an AMDP class and why is it important for an OOP interview?
A class becomes an AMDP (ABAP Managed Database Procedure) when it implements the IF_AMDP_MARKER_HDB interface. The AMDP executes SQLScript logic directly on the HANA database instead of the application server, which can improve data-intensive processing. People ask candidates about this, to determine if they know where the OOP structure and code-to-data performance design intersect.
CLASS zcl_amdp_example DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_amdp_marker_hdb.
CLASS-METHODS get_high_value_orders
The upper threshold for imported data.The maximum value of iv_threshold TYPE p
The et_orders TYPE STANDARD TABLE should be exported.
ENDCLASS.
25. What’s the difference between RAISING and EXPORTING an exception object?
RAISING in a method signature specifies which exceptions can be thrown from that method, resulting in them being caught by the caller and possibly re-thrown. There is no way of exporting an exception you raise it using RAISE EXCEPTION and catch it using TRY/CATCH, possibly reading the exported attributes from an exception object.
26. What is the Factory pattern and how do you use it in ABAP?
A static factory method determines which concrete subclass to create and returns a reference to an intermediary type (a common interface or superclass) that masks the identity of the actual subclass created.
CLASS zcl_payment_factory DEFINITION.
PUBLIC SECTION.
CLASS-METHODS create_handler
The following is an example of importing a string of type iv_type.
A return type that references a zif_payment_handler object.
ENDCLASS.
CLASS zcl_payment_factory IMPLEMENTATION.
METHOD create_handler.
CASE iv_type.
WHEN ‘CARD’.
ro_handler = NEW zcl_card_payment( ).
WHEN ‘WIRE’.
ro_handler = NEW zcl_wire_payment( ).
ENDCASE.
ENDMETHOD.
ENDCLASS.
27. Compare the difference between composition and inheritance, and when you choose one over the other?
Inheritance represents an “is-a” relationship and delegates behaviours through a class hierarchy, whereas composition means that a class owns another class and delegates behaviours to it, using a “has-a” relationship.
Use composition when you need to change behavior at runtime or when unrelated subclasses should not share logic they do not need, even if a strict hierarchy would otherwise require it.
28. Can you implement multiple inheritance with ABAP objects?
Not by classes a class is one and only one superclass. Interfaces are used to achieve multiple inheritance through the ability to implement multiple interfaces simultaneously.
29. What is a persistent class, and when is it used?
A persistent class, generated from the Class Builder on a database table, maps instances of the class directly to the rows in the database via a generated persistence layer. It is not in common use today during the modern development of S/4HANA,, as CDS-based access and RAP have taken its place.
If the interviewer moves from OOP design into runtime behaviour, prepare to explain how you would identify SQL and ABAP execution bottlenecks using tools such as ST05 and SAT in addition to explaining your class design.
30. How would you design an OOP ABAP solution to reuse the same business logic across multiple applications?
A strong approach is to separate the core business logic into a dedicated service class instead of duplicating the same code across reports, interfaces, and applications. Use interfaces when you expect different implementations, and separate database access or external dependencies from your core business logic.
For example, a reusable pricing service could expose a method such as GET_PRICE, while different applications call the same service rather than implementing their own pricing rules.
This approach improves reusability, maintainability, testability, and consistency. It also makes future changes easier because developers can update the business rule in one place instead of changing multiple programs.
Interview tip: Explain not only how you would reuse the class, but also how you would prevent the class from becoming a large “god class.” Keep responsibilities focused and separate unrelated business concerns into their own services.
Common Errors in OOP ABAP Interview Questions
One pattern shows up again and again in OOP ABAP interview questions: candidates reciting definitions instead of writing actual code. That’s exactly why interviewers ask you to program a singleton or a factory on the spot it’s the fastest way to expose someone who knows the theory but has never built with it.

The next red flag in OOP ABAP interview questions is the combination of “ABAP doesn’t support multiple interfaces” and “ABAP doesn’t support multiple inheritance.” Saying both in the same breath tells the interviewer you haven’t actually implemented interfaces in a real project; the two statements aren’t even about the same concept, and conflating them is an instant tell. Once you’re comfortable with classes and interfaces, see how these same OOP principles power modern SAP development in our ABAP S/4HANA interview questions guide.
A third mistake surfaces in OOP ABAP interview questions focused on S/4HANA: talking about persistent classes as if objects simply “don’t go away,” without mentioning CDS views or the RAP (RESTful ABAP Programming) model. On S/4HANA, that’s the keyword pairing interviewers listen for when discussing data-backed objects; skipping it signals you haven’t worked with modern persistence patterns.
Conclusion
These 35 OOP ABAP interview questions cover everything from class fundamentals to production-grade design decisions the same judgment senior SAP interviewers test for. Interviewers are looking to see if you can convert ideas like encapsulation, inheritance, polymorphism, interfaces, exceptions, factories, and singletons to working ABAP code. They would also like to know if you can explain why one design is more appropriate than the other in a real project.
The most important advice is to solve questions sequentially and write the code yourself. Work with classes; use interfaces; redefine methods; deal with exceptions; work with dependency injection; use common design patterns. In your answer, describe the requirement, explain your design decision, identify the alternative you rejected, and discuss the impact on maintainability, testing, and future design changes.
If you are preparing specifically for senior OOP roles, also review our guide to OOPS ABAP interview questions, which goes deeper into factory, polymorphism, interfaces, and senior-level design decisions.
Frequently Asked Questions
1. What is the purpose of a singleton class in a real ABAP project?
The actual reason that most developers on SAP Community quote for a singleton is the concept of shared resources: loggers, DB connection handlers, and cache objects. The Singleton pattern deep dive provides details on implementing the Singleton pattern in ABAP objects.
2. How to create a singleton?
Create PRIVATE on the class definition and a static get_instance method, which will only create the object if a static reference variable to it hasn’t been bound yet, before returning that reference on a following call.
3. What is the practical difference between the CREATE OBJECT and interface-based instantiation?
CREATE OBJECT (or NEW) always works with a concrete class; however, you can only create a reference to an object of an interface after defining the implementing class.
4. What are OOP ABAP interview questions for experienced candidates likely to focus on?
Interviews at the experienced level move from definitions to design tradeoffs, composition vs inheritance, exception hierarchy design, and patterns of the S/4HANA era, such as RAP and AMDP, and not only syntax recall.
5. Can an ABAP class implement multiple interfaces?
Yes. ABAP allows a class to implement multiple interfaces even though it does not support multiple inheritance between classes. This lets one class satisfy several contracts while retaining a single class-superclass relationship.
6. What is the difference between an abstract class and an interface in ABAP?
An abstract class can provide shared implementation and state in addition to abstract methods. An interface defines a contract that implementing classes must satisfy and can contain components such as methods, attributes, and events.
7. Can an interface be instantiated in ABAP?
No. An interface itself does not represent a concrete implementation. However, an interface reference can point to an object created from a concrete implementing class.
8. When should you use composition instead of inheritance in ABAP?
Use composition when one class needs to collaborate with another object rather than represent a specialized version of it. It is especially useful when the behavior may change independently or when inheritance would create an unnecessarily rigid hierarchy.
9. Why are interfaces useful for ABAP unit testing?
Interfaces allow business logic to depend on a contract instead of a concrete implementation. During testing, that dependency can be replaced with a controlled test implementation or test double, making the business logic easier to isolate.
10. Is AMDP required for every HANA-based ABAP application?
No. AMDP is a specialized technique for implementing database procedures in ABAP-managed database procedure classes. Use AMDP when the scenario requires database-side processing; do not treat it as a mandatory replacement for normal ABAP or CDS development. SAP documents AMDP as a HANA-oriented database procedure mechanism.