The Draft functionality in SAP RAP (ABAP RESTful Application Programming Model) is designed to enhance business application development by allowing users to create and manage draft data before finalizing it. This feature is particularly useful in scenarios where data undergoes multiple iterations before being persisted.
Key Features of Draft Functionality in SAP RAP:
- Draft Table: A dedicated draft table stores temporary versions of data before finalization.
- Locking Mechanism: Ensures data consistency during concurrent access.
- Authorization Control: Enforces instance-level authorization for actions like create, update, and delete.
Steps to Implement Draft Functionality:
- Behavior Definition: The root interface view must include draft-related statements to enable draft functionality.
- Draft Table Creation: A draft table must be created for both the root entity and associated entities to store temporary records.
- Behavior Interface Projection: The draft capability must be mentioned in the behavior interface projection entity view to extend the functionality.
- Tracking Changes: The draft tables should include fields like
LASTCHANGEDAT
to track saved records. - UI Integration: The draft functionality will appear at the UI level, allowing users to manage draft records before finalizing them.