ABAP RAP Advanced

Draft Actions

Edit with Additional Implementation & Prepare Action

Draft Action Edit with Additional Implementation

  • Draft action Edit copies the active record into the draft table
  • RAP provides a standard implementation
  • Custom logic can be added using with additional implementation
  • This implementation runs on the same instance (draft or active)
  • Example in BDEF:
draft action Edit with additional implementation;
  • Enables, for example, field manipulation or additional checks before creating the draft

Prepare Action in Draft Handling

  • Prepare is a draft determine action
  • Executed before activation (Activate)
  • Used for pre-calculation, validation, and data enrichment
  • Specify in Behavior Definition:
draft determine action Prepare;
  • Implementation is done in the behavior class using a method with FOR DETERMINE for Prepare
  • Example: Calculate composite fields before activation

Process Flow for Edit & Prepare in Draft

  1. User initiates Edit → Edit action with additional implementation runs
  2. User saves draft → Prepare action is triggered
  3. Prepare performs preparations (e.g., calculations, validations)
  4. Activation (Activate) saves final data into the active table

Advantages of This Approach

  • Flexibility through custom logic during the Edit process
  • Clear separation between Edit and final activation
  • Ensures data integrity with Prepare before commit
  • Performance optimization by preparing data in advance

Summary

  • Edit with additional implementation offers flexible extensibility
  • Prepare is essential for consistent draft-to-active transitions
  • Both actions are key elements in RAP draft handling
  • Behavior Definition is central for control and implementation