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

SAP Marketing Cloud Odata API with Upsert function Integration with AWS

bhaskar_idp
Explorer
0 Likes
1,137

Hi,

I have created CBO to consume data from external system in AWS.
I created custom communication scenario and arrangement. I am trying to post the data into system by using sap_upsert import function but not able to post it.

I am using Postman with x-csrf token but still not able to do.

Please check here for error.

Please check the payload here.

Any idea on this?

If this is not possible i need to use CUAN_BUSINESS_DOCUMENT_IMP_SRV service to import the data.

For all of my scenario's we are avoiding integration with SCPI.

Regards,

Bhaskar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hi bhaskar.idp. The other option you have is using the $batch operation to update the instances of the CBO.

For that option you will need the following:

1. Get the UUID from the CBO

Example query: https://myXXXXXX-api.s4hana.ondemand.com/sap/opu/odata/sap/YY1_CBO_NAME_CDS/YY1_CBO_NAME?$format=jso... eq 'value'

From the result you must get the SAP_UUID attribute.

2. Use the $batch operation

URL: https://myXXXXXX-api.s4hana.ondemand.com/sap/opu/odata/sap/YY1_CBO_NAME_CDS/$batch

Body:

--batch
content-type: multipart/mixed;boundary=changeset

--changeset
content-type: application/http
content-transfer-encoding: binary

MERGE YY1_CBO_NAME(guid'<the one you get from the SAP_UUID value>') HTTP/1.1
Accept: application/json
content-type: application/json
SAP-CUAN-ForceSynchronousProcessing: X

{
    "Att1": "Value1",
    "Att2": "Value2"
}

--changeset--
--batch--

With that you will be able to update the CBO instance. Let me know if you need more help.

Regards,

Answers (3)

Answers (3)

bhaskar_idp
Explorer
0 Likes

Thanks all for the response.

former_member226
Employee
Employee
0 Likes

Hi Bhaskar,

When using"Sap_upsert" no need to pass any payload/body. "Sap_upsert" is a function import(or in other words action) for which system do not expect any data as body/payload. You need to pass everything in the URL itself as mentioned in the official documentation.You can also find a detailed explanation here: https://answers.sap.com/questions/12698514/upsert-in-odata-service.html

For example you have a BO Named YY1_TEST1103 whose root node is also called as "YY1_TEST1103". This BO Contains 3 fields: ID,ID_ORIGIN, TEST. In such case in order to trigger a upsert request you just need to call following URL with POST method:

https://<HostName>/sap/opu/odata/SAP/YY1_TEST1103_CDS/YY1_TEST1103Sap_upsert?ID='sk@sap.com.de'&ID_ORIGIN='EMAIL'&TEST='API'

postman-api-call.png

I hope it helps a bit.

BR
Saurabh

maik_bosch
Contributor
0 Likes

Hi Bhaskar,

please follow 🙂

https://blogs.sap.com/2017/05/12/usage-of-odata-service-of-custom-business-object/

I think Eileen did a great job here.

Thanks and regards

Maik