cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to do Batch call in RAP Odata with CHANGE_SET enabled for CREATE, UPDATE, and DELETE Operations?

Rajesh_Amirinen
Explorer
0 Likes
3,494

Hi Everyone,

I have a RAP OData service with multiple entities with navigation relation( composition ).
UI developer can be able to do DEEP CREATE with multiple entities in a single call?

but for Update operations which may include update, create, and delete we need to use Batch operation to club all operations and send in a single request to the backend.

But I want to use change_set( deferred mode ) operation for all the create, update and delete operations so that it will happen in one session with either complete success of all operations or None in case of any error in any of the operation. 

I saw the invocation grouping UI annotation for grouping actions in a change_set.

But how to acheive same for create, update and delete operations( CRUD ).?

Thank you in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Likes

In RAP, multiple operations must be grouped under a single changeset within the $batch call to ensure they are processed as one atomic Logical Unit of Work(All-or-nothing). Because the RAP runtime handles the DB commits automatically, there is no need to explicitly implement defer mode or redefine changeset methods as you would in a classic DPC_EXT class.

The Create, Update, and Delete methods of the RAP Business Object are designed for mass processing, meaning their IMPORTING parameters(keys or entities) contain multiple entries representing all the operations bundled within that single changeset.

AbhishekSharma
Active Contributor
0 Likes

Hi @Rajesh_Amirinen 

You may try to use concept #ISOLATION and #CHANGE_SET

Using #ISOLATION - You may allow process multiple data which are valid per your use case and show failed records as error... 

You may want to watch below reference videos, may help:

ABAP RAP CHANGE_SET 

ABAP RAP Isolation 

Hope this helps...

Thanks-

Abhishek

 

Rajesh_Amirinen
Explorer
0 Likes
Thank you @AbhishekSharma,
Rajesh_Amirinen
Explorer
0 Likes

 @AbhishekSharma, But I need this with create operation, change operation, and delete operation of the entities, not to specific action of the Business Object.

DarshanAsknani
Explorer
0 Likes
did you find the answer for this?