cancel
Showing results for 
Search instead for 
Did you mean: 

XSOData Create or Update

Sophie_V
Advisor
Advisor
0 Kudos

Hi Experts,

I'm developing a XSODATA service using HANA 1.0 SPS12.

This service exposes one principal CDS entity ('Project') and I need to create or update data entries for this entity from ABAP stack.

Typically, the entries should be created during the first call and updated during the following calls.

But the ABAP client is not aware of the right operation (CREATE/POST or UPDATE/PUT).

I have implemented first a XSJS service which receives only POST requests. This way, I was able to put the logic create/update on server side. Now, I would like to have the same behavior in XSODATA but I don't know how to achieve this.

I thought about calling a procedure during creation but is it really relevant for updating entries?

A kind of UPSERT statement for XSODATA and HANA 1.0 would be perfect...

What is recommended here?

Thank you,

Sophie

Former Member
0 Kudos

Hello Sophie,

We are also stuck in same situation where not able to use Upsert operation in XSODATA.

We are integrating PO with Hybris marketing. Since create and update not possible in the same call we may need to do some complex logic in PO.

So can you please tell us what approach you made to solve this problem? and also give us the brief about the steps taken?

Thanks and Regards,

Sriram

View Entire Topic
former_member208449
Active Participant
0 Kudos

Hi Sophie

You can override the generic Odata POST/PUT/DELETE operations by using Odata modification exits that can be written in either XSJS/SQL Script. For the PUT operation, we will have to send a key i.e the ID to be updated. If it fits your usecase so that you can send in the ID and you are still ok to do an UPSERT, then you can do it via OData exits.