RAP Basics
Architect / Cross-trackintermediate

RAP Basics Part 4: Implementation Types — Managed, Unmanaged, Additional Save and Unmanaged Save

Key takeaway

Choose the transactional model of a RAP BO: managed (framework does CRUD and save), unmanaged (you implement everything, typically wrapping legacy BAPIs), and the two hybrids — managed with additional save and managed with unmanaged save — with decision criteria for greenfield and brownfield projects.

Explanation

📌 KEY POINTS
✅ Managed: the framework provides the transactional buffer, CRUD and the save to your own tables — you add only business logic.

✅ Unmanaged: you implement create/update/delete, read, lock and save yourself — used to wrap existing application logic (BAPIs, function modules).

✅ Managed with additional save: framework saves, you add extra saving (change documents, application log, outbound calls) in save_modified.

✅ Managed with unmanaged save: framework handles the buffer and interaction phase, but you write the data yourself (e.g. via a legacy update function).

⚠️ Choosing unmanaged for a new BO with its own tables multiplies code and bugs for no benefit.

━━━━━━━━━━━━━━━━━━━━
▶ WHERE WE ARE

Parts 2–3 built the data model and projection. Now the key architectural decision: who does the transactional work?

━━━━━━━━━━━━━━━━━━━━
▶ 1. MANAGED

  • Header: managed implementation in class zbp_i_travel unique;
  • persistent table ztravel_a — the framework reads, buffers and writes.
  • Numbering, locking, ETags, draft all supported out of the box.
  • Best for greenfield BOs with their own Z tables.

━━━━━━━━━━━━━━━━━━━━
▶ 2. UNMANAGED

  • Header: unmanaged implementation in class zbp_i_salesorder unique;
  • You implement create/update/delete/read/lock in handler classes and finalize/check_before_save/save/cleanup in a saver class.
  • Your code maintains its own buffer (usually a static attribute in a buffer class).
  • Typical: wrap BAPI_SALESORDER_CREATEFROMDAT2 to expose standard sales orders.

━━━━━━━━━━━━━━━━━━━━
▶ 3. MANAGED WITH ADDITIONAL SAVE

  • with additional save in the BDEF entity.
  • Framework saves normally; your saver method save_modified runs in the same LUW for extra writes.
  • Use for change documents, application log, triggering an outbound event.

━━━━━━━━━━━━━━━━━━━━
▶ 4. MANAGED WITH UNMANAGED SAVE

  • with unmanaged save — no persistent table; you write in save_modified.
  • Keeps managed buffer, draft and numbering benefits while the data lands via legacy update logic.

━━━━━━━━━━━━━━━━━━━━
▶ 5. DECISION MATRIX

  • New Z tables, no legacy logic → managed.
  • New Z tables + need change docs/logging → managed with additional save.
  • Existing tables written only by legacy update FMs → managed with unmanaged save.
  • Existing complete logic in BAPIs, including checks → unmanaged.
  • Remember: in S/4HANA many standard objects already have released RAP BOs — check before wrapping BAPIs.

━━━━━━━━━━━━━━━━━━━━
▶ STEP BY STEP

  1. List the BO's tables and who owns their update logic today.
  2. Pick the implementation type from the matrix.
  3. Set the BDEF header and the save option.
  4. Generate the behavior pool and implement only what the type requires.

✅ CHECKPOINT: you can defend your implementation type in a design review with one sentence per alternative.

Code example

ABAP Code
// ===== STEP 1: managed with additional save =====managed with additional save implementation in class zbp_i_travel unique;strict ( 2 ); define behavior for ZI_Travel alias Travelpersistent table ztravel_alock masterauthorization master ( instance )etag master LocalLastChangedAt{  create; update; delete;  field ( readonly, numbering : managed ) TravelUUID;} // ===== STEP 2: unmanaged header - you implement everything =====// unmanaged implementation in class zbp_i_salesorder unique;// define behavior for ZI_SalesOrderU alias SalesOrder// lock master// authorization master ( instance )// { create; update; delete; } * ===== STEP 3: saver class for additional save (behavior pool, local types) =====CLASS lsc_zi_travel DEFINITION INHERITING FROM cl_abap_behavior_saver.  PROTECTED SECTION.    METHODS save_modified REDEFINITION.ENDCLASS. CLASS lsc_zi_travel IMPLEMENTATION.  METHOD save_modified.    DATA ls_travel LIKE LINE OF create-travel.    DATA lv_msg    TYPE string. * ===== STEP 4: extra writes in the same LUW (no COMMIT WORK here!) =====    LOOP AT create-travel INTO ls_travel.      CONCATENATE 'Travel created:' ls_travel-TravelID INTO lv_msg SEPARATED BY space.*     write change document / application log entry here    ENDLOOP.  ENDMETHOD.ENDCLASS.

Real project scenario

A client moving from ECC to S/4HANA wanted a Fiori app to create customer returns. The first design was fully unmanaged, re-implementing buffer, locks and save around BAPI_CUSTOMERRETURN_CREATE — about 2,000 lines of handler code. The architect first checked the API Business Hub and found the released RAP BO for customer returns (I_CustomerReturnTP), which could be consumed with EML from a small custom BO. Where no released BO existed (a custom rebate agreement table maintained by legacy update function modules), the team used managed with unmanaged save, keeping draft and locking from the framework and calling the legacy update module in save_modified. Custom code shrank by around 70%.

Common mistakes

  • Choosing unmanaged for a brand-new BO with its own tables.
  • Wrapping a BAPI in unmanaged RAP when SAP already delivers a released RAP BO for the object.
  • Calling COMMIT WORK inside save or save_modified — the framework controls the LUW.
  • Doing extra writes in a determination instead of save_modified.
  • Forgetting the buffer class in unmanaged scenarios, so read after create returns nothing.

Best practices

  • Default to managed; move to hybrids only for a concrete need.
  • Check released RAP BOs and APIs before wrapping BAPIs.
  • Keep unmanaged buffers in a dedicated singleton buffer class.
  • Put side writes (logs, change documents) in save_modified of an additional save.
  • Document the chosen type and the reason in the design document.

Interview angle

Questions: "Managed vs unmanaged RAP — when do you use which?", "What is managed with additional save?", "How would you expose an existing BAPI-based process in RAP?"
Strong answer: managed for new BOs on own tables; unmanaged when existing application logic (BAPIs) must own create/update/save; managed with additional save for extra side effects; managed with unmanaged save when the framework should run the interaction phase but data must be written by legacy update logic. A senior candidate first checks for a released SAP RAP BO before wrapping a BAPI and never commits inside the save sequence.

Practice this lesson

Quick check

1. A developer adds COMMIT WORK at the end of save_modified in a managed BO with additional save. What is correct?

2. A new BO on custom tables should use standard framework CRUD and draft, but must also write change documents whenever data is saved. Which implementation type fits best?

3. In a managed RAP BO on its own tables, who implements create, update, delete and the database save?

Interview questions

1. A new approval app on custom tables needs standard CRUD, draft, and in addition must write change documents and an application log entry whenever an approval request is saved. Which RAP implementation type do you choose and where does the extra logic go?

Answer it in your own words first, then compare.

2. Explain the difference between managed and unmanaged RAP business objects.

Answer it in your own words first, then compare.

Practice more with Interview AI →

Reference-verified: the steps are checked against official SAP documentation and tutorials, and object and field names in the sample code are checked for consistency. The code has not been compiled or run on an SAP system by ERPClimb. Syntax marked release-dependent varies by SAP release, so check it in your own system.

More lessons in this topic

Interview questions on this topic

Related SAP topics