cancel
Showing results for 
Search instead for 
Did you mean: 

Upsert in Custom Business Objects in Hybris Marketing with ODATA

former_member355106
Active Participant
0 Kudos

Hi guys,

We want to fill a custom business object in Hybris Marketing Cloud with ODATA from a Source System.

It seems like:

  • POST: creates a new entry
  • PUT: Updates an entry
  • DELETE: Deletes an entry.

The Problem is that there is no UPSERT Version. We can not differentiate between new and updated entries so it would be nice that the system creates an entry when it is not there and updates the entry when it does not exist. Neither POST nor PUT can be used for that. POST throws an error when the entry already exists and PUT throws a message when the entry does not exist.

Is there another way for upsert? We have a similar problem with DELETE. It throws an error when the entry does not exists.

Thank you

Accepted Solutions (0)

Answers (5)

Answers (5)

ashik_k2
Contributor

FYI theodor.lungstras johannes.hirling maik.offerle : The CBO odata service generated now supports upsert function import (by name xxxxxxxSap_upsert).

danny_lipkovski2
Participant
0 Kudos

Hi Ashik,

do you have any details on how to use the upsert functionality of CBO-OData?

Regards

Danny

elena73
Explorer
0 Kudos

Hi All,

we have open a customer influence for this issue.

Feel free to vote it in order for SAP to consider it

https://influence.sap.com/sap/ino/#/idea/222858

former_member247020
Active Participant
0 Kudos

There is a very good blog post on updating cbo entries.

https://blogs.sap.com/2017/12/05/setup-of-cpi-iflow-with-custom-business-object/

You still need to check for each entry individually if the uuid exist and have the message mapping mapping the value accordingly.

hope this helps.

br,

Johannes

arunprakash_karuppanan
Active Contributor

I left a similar comment under that blog at the beginning of this year. From a design perspective, what is perplexing is that SAP allows us to define the structure of the CBO, define its semantic keys and yet, it feels the need to impose its own technical key on top of what the customer has specified. To what end? It's perfectly possible to generate a OData service even with a composite key set. It is one thing to use the SAP UUID internally, but to force it in the generated OData service is a step backward. Compare this with the Interaction Contact or Interactions data model, where it is perfectly possible to address an object with only the external keys. There are key mapper services (mashup) to allow external systems to host links to an object (eg: Contact Factsheet / Profile) using identifiers known to them (not the SAP UUID).

Yes, the solution in the blog (the "enrich" step) will work and as of now, the only way. But it just feels weird and from a performance perspective (especially, a synchronous message processing scenario), it is something we can do without.

Best Regards,

Arun Prakash

dominic4
Active Participant
0 Kudos

I agree with Arun.

Also the solution is not working for masses of data. At some specific situations we have a lot of changes in a cbo and this would mean we have 100 000 and more requests to the marketing cloud.

I solved this with a splitting the data into chunks of 150 entrys and use the filter option in odata to get all uuids from these entrys. Seems like there is not batch option to make GET queries.

All in all it would be nice when we could use our own keys or directly upsert data with our own uuids.

arunprakash_karuppanan
Active Contributor
0 Kudos

I'm also interested in this topic. A MERGE is still an update (specific fields) and therefore needs the technical key of the object. Technically, the ODATA PUT request can accommodate UPSERT scenarios, if the keys are known.

Where this is thwarted is that SAP generates the technical keys (UUIDs) internally and does not use the logical/surrogate keys defined during the creation/designing of the CBO. Therefore, there is always a need to "enrich" the ODATA request by making a preliminary request for technical keys. Why cannot the processor use the "external" keys in the request to identify if it is an insert/update? Funnily, this preliminary request for the technical UUIDs are almost always based on the said "external" keys.

Best Regards,

Arun Prakash

former_member267312
Contributor
0 Kudos

maik.offerle & johannes.hirling can you shed some light here? Thanks

former_member267312
Contributor
0 Kudos

Hi Oliver,

Not sure if it helps, but have you tried "MERGE"?

You will find an example here:

Usage of OData Service of Custom Business Object