ABAP for Cloud Development
AS ABAP Release 914, ©Copyright 2024 SAP SE. All rights reserved.
ABAP - Keyword Documentation → ABAP RAP Business Objects → RAP - Behavior Definitions → RAP - BDL for Behavior Definitions → RAP - Managed and Unmanaged Behavior Definitions → RAP - BehaviorDefinitionHeader →
RAP - with draft
Syntax
...
with draft;
...
Description
The addition with draft
enables RAP draft handling for a business object. It is added in the behavior definition header as it draft-enables the entire business object. It is not possible to implement draft capabilities for individual entities within a business object.
RAP draft handling is in all scenarios completely managed by the RAP transactional engine. The application developer is not responsible for how draft data is written to the draft database table.
Availability
- Managed RAP BO
- Unmanaged RAP BO
- In projection BDEFs and in interface BDEFs, draft handling can be reused from the underlying base BO using the syntax addition
use draft
. For details, see topic RAP -use
, Projection and Interface BDEF.
Dependencies
The addition with draft
enables draft handling. There are several related syntax elements in the behavior definition:
draft table
query
:- A RAP draft table is required for storing draft instances. It is defined using the keyword
draft table DraftTableName
. A draft table is mandatory for draft-enabled BOs. A draft query view can optionally be specified for a RAP draft table using the additionquery
. total etag
:- The total ETag is a designated field in a draft-enabled business object that indicates changes between the active and the draft version. A total ETag is mandatory for draft-enabled implementations.
- draft actions:
- RAP draft actions are actions that are available for draft-enabled business objects only. They allow data to be manipulated on the RAP draft table. They are implicitly available as soon as a business object is draft-enabled, but can be declared explicitly.
- draft-enabled associations:
- A draft-enabled association retrieves active data if it is followed by an active instance and draft data if is followed by a draft instance. An association is draft enabled using the syntax addition
with draft
. In a draft-enabled RAP BO, it is mandatory that associations are draft-enabled.
Further Information
Development guide for the ABAP RESTful Application Programming Model, topic Draft.