All topics
ABAPIntermediate

OOP ABAP

Master Object-Oriented ABAP with classes, objects, methods, constructors, encapsulation, interfaces, factory methods, testing and S/4HANA-ready design.

Overview

Master Object-Oriented ABAP with classes, objects, methods, constructors, encapsulation, interfaces, factory methods, testing and S/4HANA-ready design.

Lessons in this topic

Interview questions covered

  • Explain the difference between an interface and an abstract class in ABAP Objects.
  • Explain visibility modifiers (PUBLIC, PROTECTED, PRIVATE) in ABAP OO. How do they enforce encapsulation, and what is the impact on inheritance hierarchies?
  • Explain RTTI (Runtime Type Information) and RTTS (Runtime Type Services) in ABAP. Design a generic data validation and serialization class using RTTI.
  • Explain the difference between the instance constructor and the static constructor in ABAP OO. When is each executed, and when would you use each?
  • Explain abstract classes and final classes in ABAP OO. When would you mark a class as ABSTRACT or FINAL, and what design constraints does this enforce?
  • Compare static methods and instance methods. When should you use each, and what are the implications for state management and testability?
  • Explain object references and object lifetime in ABAP OO. When are objects automatically garbage collected, and how does this differ from function module data?
  • Explain exception handling in OO ABAP. Design a custom exception hierarchy for a material master API that handles validation errors, not-found errors, and database errors gracefully.
  • How do you evolve an ABAP monolith toward clean OO without a rewrite?
  • What is the difference between an interface and an abstract class?
  • Method call raises CX_SY_REF_IS_INITIAL. What happened?
  • What is polymorphism in ABAP?
  • Explain the difference between a local class and a global class in ABAP OO. When would you use each, and what are the implications for maintainability and reusability?
  • You need to send notifications through Email, SMS, and Teams. How would you design this in ABAP OOP?
  • When is inheritance the right choice over composition in ABAP?
  • Explain the CREATE OBJECT and NEW operator for instantiating objects. What are the differences, and when would you use each in modern ABAP?
  • How do you apply Dependency Injection in ABAP?
  • What are static-check and dynamic-check exceptions?
  • How do you implement a factory pattern in ABAP?

Related topics