Ansicht
Dokumentation
ABENBDL_WITH_DRAFT - BDL WITH DRAFT
rdisp/max_wprun_time - Maximum work process run time Vendor Master (General Section)This documentation is copyright by SAP AG.
- with draft
...
with draft;
...
Effect
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. However, implementation exits exist that allow scenario-specific capabilities to be implemented.
In projection BOs, draft handling can be reused from the projected BO using the syntax addition use draft. For details, see topic CDS BDL - use, projection BDEF.
Unmanaged RAP BO
In unmanaged RAP BOs, the following restrictions apply:
- Late numbering is not supported.
- Associations that use NOT in the binding condition can't be draft-enabled.
- The following RAP BO operations can't be executed on draft instances:
- direct create operations on child instances (there's no syntax error in BDL, but a short dump occurs at runtime).
Dependencies
The addition with draft enables draft handling. There are several related syntax elements in the behavior definition:
- A RAP draft table is required for storing draft instances. Defined using the keyword draft table DraftTableName. Mandatory for draft-enabled BOs.
- The total ETag is a designated field in a draft-enabled business object that indicates changes between the active and the draft version. Total ETag is mandatory for draft-enabled implementations.
- The draft actions Edit, Activate, Discard, Resume, and Prepare are available for draft business objects. They are implicitly available as soon as a business object is draft-enabled, but can be declared explicitly.
- 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. Mandatory for draft-enabled BOs.
Development guide for the ABAP RESTful Application Programming Model, topic Draft.
Notes
If the draft action Edit is enabled implicitly, then it automatically comes with
instance feature control and an implementation in the
ABAP behavior
pool is required. In the following examples, it is enabled explicitly without feature control, so that both implementation scenarios (managed and unmanaged) can be handled by the
managed RAP BO provider.
Example - Managed
The following example shows a managed BDEF based on the CDS root view entity DEMO_RAP_MANAGED_DRAFT_ROOT. It is draft-enabled and it has all mandatory syntax elements.
The draft is completely handled by the RAP framework; no implementation in the ABAP behavior pool is required.
The program DEMO_RAP_MANAGED_DRAFT accesses the business object using EML and performs the following steps:
- It creates two new draft instances of the parent entity and two new draft instances of the child entity and displays the content of the draft tables.
- Then it activates the draft entities. The content of the draft tables is written to the
persistent tables and the draft tables are emptied.
Example - Unmanaged
The following example shows an unmanaged BDEF based on the CDS root view entity DEMO_RAP_UNMANAGED_DRAFT_ROOT. It is draft-enabled and it has all mandatory syntax elements.
The draft is completely handled by the RAP framework; the ABAP behavior pool implements the business logic only for the active entity.
The program DEMO_RAP_UNMANAGED_DRAFT accesses the business object using EML and performs the following steps:
- It creates two new draft instances of the parent entity and two new draft instances of the child entity and displays the content of the draft tables.
- Then it activates the draft entities. The content of the draft tables is written to the
persistent tables and the draft tables are emptied.
BAL Application Log Documentation General Data in Customer Master
This documentation is copyright by SAP AG.
Length: 9122 Date: 20240329 Time: 063542 sap01-206 ( 105 ms )