SAP Knowledge Base Article - Public

2891535 - Execution of POST Method for OData Service Does not Upload Data to the KUT Field

Symptom

Your requirement is to create data using the OData Service and for the related KUT field. Upon executing the OData Service, data is created in system, but the issue is with KUT field which is ZField, where the data is not uploaded. Although the required value is passed in the Request payload for the KUT field, the field appears blank.

where ZField is the KUT field
myxxxxxx represents the tenant
Yyyyyyyyyy is the object in OData Collection

Environment

SAP Cloud for Customer

Reproducing the Issue

Execute the POST method for the below Service in OData Service Explorer:

  1. Go to Administrator work center
  2. Go to OData Service Explorer view
  3. Show SAP OData Services
  4. Highlight the Service name c4codataapi and select Test
  5. On the OData Console, in the left pane, select the required Entity Set
  6. Select the Test tab
  7. Select the POST method for https://myxxxxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/YyyyyyyyyyCollection
  8. Input data for the required fields
  9. Select Execute

You receive a Response that the data is successfully created.

Verify the data in the respective work center view and observe that only KUT field ZField is still blank.

Cause

The affected extension field has extension scenario where at runtime, the value gets overwritten from source Business Object.

Example:
Consider the below OData Service, for which the data for KUT field ZField is not uploaded when you execute the POST method.

https://myxxxxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/RegisteredProductCollection

In this case, source Business Object is PDM_MATERIAL. It is an expected behavior that whenever an extension scenario is enabled, a value from payload will get overwritten by value from source Business Object. In this example, source Business Object has no value for given extension field for given instance.

Resolution

For the POST method to execute successfully, disable the extension scenario for the affected KUT field or create an extension field without any extension scenario. Thereafter, execute the POST method for the respective OData Service.

Whereas, in the Update scenario (PATCH method), the extension scenario does not work. That is, during Update scenario, the application is not calling the extension scenario. This is the designed behaviour.

Therefore, you may use one of the below options:

1. Use a field that is not linked to the extension scenario, so that the data which is being passed in the OData gets reflected in the extension field on the Business Object without being overwritten by the value from the source Business Object.

In the above example, use a field that is not linked to the extension scenario, so that the data which is being passed in the OData gets reflected in the extension field on /IBASE/INSTALL_POINT BO without being overwritten by the value from the source Business Object PDM_MATERIAL.

2. You can perform 2 calls of OData. That is, first a Create call and then an Update call on the same extension field.

Keywords

OData, _KUT, KUT, Extension field, Extension scenario, PDM_MATERIAL, Business Object, Registered Product, RegisteredProduct, POST, PATCH , KBA , registeredproduct , extension field , extension scenario , business object, , pdm_material , kut , odata , registered product , LOD-CRM-INT-API , OData API (C4C Only) , Problem

Product

SAP Cloud for Customer add-ins all versions ; SAP Cloud for Customer core applications all versions