0% found this document useful (0 votes)
89 views9 pages

Managed Save Sequence (Additional and Unmanage Save)

Managed Save sequence with additional save

Uploaded by

anand2201206
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views9 pages

Managed Save Sequence (Additional and Unmanage Save)

Managed Save sequence with additional save

Uploaded by

anand2201206
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Tuesday, December 30, 2024

By: Devi Prasad Mishra

Managed Scenario Save Sequence(Additional Save and


Unmanaged Save).
The managed save sequence is a key concept in the RAP (Restful Application Programming) framework used to
handle persistence operations for entity instances in ABAP. It automates the process of saving changes made to
an entity while allowing customization when needed.

Key Components of the Managed Save Sequence

1. Standard Behavior

o Automatically saves changes made to entity instances in the database.

o Ensures consistent data persistence without requiring additional coding.

2. Steps in the Sequence

o Data Validation: Validates the modified instance to ensure data integrity.

o Data Modification: Updates or inserts the instance data into the database.

o Lifecycle Management: Manages the lifecycle events triggered during the save process.

o Post-Save Actions: Completes any final actions after the data persisted.

3. Customizing with Extra Save

o The extra save feature allows adding additional logic to the save process, such as logging
changes or triggering external services.

o Developers can implement additional steps using the save_modified method in a saver class.

4. Change Tracking

o Logs changes made to an instance, such as modified fields or newly added data.

o These changes can be written to a log table for auditing or debugging purposes.
Tuesday, December 30, 2024
By: Devi Prasad Mishra

1. Additional Save
The RAP framework supports adding extra functionality to the managed save sequence via the extra
save feature, allowing reuse of services like change documents and application logs. By default,
managed saves handle this, but additional steps can be included using the saver class and the save
modified method. When an entity instance is updated, changes are saved, including updated fields,
data, and completed operations. In this scenario, modified data is recorded in a log table.

Action: Create the log table to store the changes.


Tuesday, December 30, 2024
By: Devi Prasad Mishra

To enable additional saving in a managed scenario:

a) Behavior Definition: Define the additional save for the entity.


b) Implementation Class: Create a local class and implement the save_modified method.

This setup ensures the modified data is handled appropriately.

When a new instance is created, additional data is stored in the entity's database and log table.

Steps:

1) Define Saver Class: Create a saver class in the behavior definition.


2) Behavior Pool: Implement required methods in the behavior pool.
3) Save_Modified Method: Implement the save_modified method in the saver class to handle
the additional save logic.

This ensures proper handling of additional data during entity creation.


Tuesday, December 30, 2024
By: Devi Prasad Mishra
Tuesday, December 30, 2024
By: Devi Prasad Mishra

For creating an instantiation operation.

In log table.

For Edit.

In log table

For Delete.
Tuesday, December 30, 2024
By: Devi Prasad Mishra

In log table

2. Unmanaged Save

Unmanaged save is ideal when the default save logic in the RAP framework (managed save)
cannot handle specific business requirements. It gives developers full control over how data persisted,
enabling customization for complex scenarios like:
 Custom Table Structures: When data is stored in unconventional formats or across multiple tables.
 Advanced Integrations: When saving data involves external APIs or systems.
 Complex Logic: For operations requiring extensive calculations, validations, or dependencies between
entities.

Steps to implement unmanage save.


Before that ensure persistence, table is not specified, as unmanaged save implementation cannot have
persistence table specified to it.

Step 1: Include the unmanaged save keywords for all nodes where unmanaged behavior is required.

Step 2: Redefine method save_modified in Saver Local class implementation level.


Tuesday, December 30, 2024
By: Devi Prasad Mishra

Here, I have used SQL queries, but instead, you can call external APIs or existing
function modules to perform Create, Update, or Delete (CUD) operations.
Tuesday, December 30, 2024
By: Devi Prasad Mishra

Fiori Application Preview.

Create

Update
Tuesday, December 30, 2024
By: Devi Prasad Mishra

Delete

Conclusion:

In RAP applications, both Additional Save and Unmanaged Save offer essential flexibility for customizing
data persistence:

 Additional Save enhances the standard managed save sequence, allowing developers to introduce
custom functionality (like logging or external integrations) while still utilizing the framework’s built-in
features for validation and lifecycle management.

 Unmanaged Save provides full control over the save process, enabling developers to implement
custom Create, Update, delete (CUD) operations, such as using SQL queries, external APIs, or function
modules, for more complex or non-standard requirements.

Both methods empower developers to tailor data management in the RAP framework, ensuring the application
can meet diverse and complex business needs.

You might also like