The ABAP RESTful Application Programming Model (RAP) offers two primary approaches for implementing business objects (BOs): managed and unmanaged. These approaches differ in how transactional logic, CRUD operations, and persistence management are handled. Below is a detailed comparison, including practical examples.
Core Definitions
Managed BO :
Delegates transactional logic to the RAP framework. The framework automatically handles CRUD operations (Create, Read, Update, Delete) , Locking and draft handling , Interaction and save phases (transaction buffer management) , Developers focus on business logic (validations, determinations, actions) rather than technical implementation.
Unmanaged RAP Business Object:
An unmanaged BO requires developers to manually implement transactional logic in ABAP classes. This approach is used when:
- Integrating legacy code (e.g., BAPIs, function modules).
- Requiring full control over database operations.
- Handling complex cross-system interactions.
Key Differences Managed BO Vs Unmanaged BO:
- CRUD Implementation Automatic via RAP framework Vs Manual coding in behavior implementation classes
- Locking : Auto-managed Vs Manual implementation via ENQUEUE/DEQUEUE
- Draft Handling : Built-in Vs Must be manually coded
- Transaction Buffering : Managed by framework Vs Custom buffer handling required
- Use Case : Greenfield projects Vs Brownfield projects with existing code
- Code Overhead : Minimal (focus on business logic) Vs High (full control over persistence)