Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for upsert operation #4459

Open
memgavdilabs opened this issue Feb 2, 2024 · 3 comments
Open

Support for upsert operation #4459

memgavdilabs opened this issue Feb 2, 2024 · 3 comments
Labels
feature request Requests for new functionality

Comments

@memgavdilabs
Copy link

Hi team,

Is your feature request related to a problem? Please describe.
We are using the sap cloud sdk (js) for batch requests to a SAP Successfactors instance since it is not provided out of the box by SAP CAP. SAP Successfactors have a lot of entities where only upsert is supported to add/change records. An example of a standard SAP SF entity is EmpJobRelationships which contains the employee relationship information to one or more managers. The metadata for such an entity in successfactors is defined as:
<EntitySet Name="EmpJobRelationships" EntityType="SFOData.EmpJobRelationships" sap:label="Job Relationships" sap:creatable="false" sap:updatable="false" sap:upsertable="true" sap:deletable="false"> <Documentation> <Summary>EmpJobRelationships</Summary> <LongDescription>Contains the employee relationship information to one or more managers.</LongDescription> <sap:tagcollection> <sap:tag>Employee Central (EC)</sap:tag> <sap:tag>EC - Employment Information</sap:tag> </sap:tagcollection> </Documentation> </EntitySet>
Based on the definition sap:creatable and sap:updatable are false leaving us with only using upsert.

Describe the solution you'd like
We would like support for upsert operation in such cases, so we could also use it in batch operations.

Describe alternatives you've considered
To process the request without use of sap cloud sdk batch feature. This surely introduces complications with data integrity as we cannot take advantage of the changeset feature of data submission.

Impact / Priority
We are developing an application to terminate employee relationships in SAP SF, based on employee transfers/exits. In scenarios where a manager leaves the organization or moves to another team, we would like to update all the EmpJobRelationships of all the subordinates of this manager, so it could be a big chunk of data that needs updating hence we would need the batch with upsert.

Affected development phase: Development

Impact: Inconvenience, Impaired

Timeline: Go-Live is in 5 weeks.

@memgavdilabs memgavdilabs added the feature request Requests for new functionality label Feb 2, 2024
@jjtang1985
Copy link
Contributor

Thanks for reaching out @memgavdilabs.

The upsert is a OData v4 feature that SDK does not support for the time being.
I found a nice blog post here for the upsert as well.

Unfortunately, this is not planned for the near future and I'll leave it open for now.
Maybe talking to CAP, so they can consider supporting batch and upsert :)

Best regards,
Junjie

@memgavdilabs
Copy link
Author

Hi @jjtang1985

The upsert is used extensively by SAP Successfactors in OData V2 version. I looked into the metadata of a SAP Successfactors instance and in the edmx file, they have defined the upsert as follows:
<FunctionImport Name="upsert" ReturnType="Collection(SFOData.UpsertResult)" EntitySet="UpsertResult" m:HttpMethod="POST" sap:support-payload="true"></FunctionImport>

If i generate the cloud sdk odata client for this function import, it creates a typed operation called upsert(), but with empty parameters, so i am unable to pass the data payload as a parameter to the upsert operation. Further it also gives a warning regarding the reserved keyword name upsert.

Is there any solution to this ?

Regards,
Melwyn

@deekshas8
Copy link
Contributor

Hi @memgavdilabs,

We discussed the support for upsert operations in the team, I will open a ticket to investigate the effort and what the API could look like. Could you share a link to the service spec of the SuccessFactors service you are using? Then I can check how it's generated and if support is easy.

As a workaround, I can suggest using the generic client to execute plain HTTP requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new functionality
Projects
None yet
Development

No branches or pull requests

3 participants