SAP Knowledge Base Article - Public

2689541 - Structure of Amount Field in OData Service

Symptom

You created a Custom OData Service PQR before 1708 release in system myxxxxxx.crm.ondemand.com Upon executing the OData query, the structure for any of the Amount field XYZ is as below and the data is not populating for the Amount fields.

Example:

<d:AmountReceived m:type="cust.Amount">
<d:currencyCode>USD</d:currencyCode>
<d:content>0.00000</d:content>
</d:AmountReceived>

You created the same Custom OData Service PQR after 1708 release in system myzzzzzz.crm.ondemand.com. Upon executing the OData query, the structure for any of the Amount field XYZ is as below and data appears for the Amount fields.

Example:

<d:AmountReceived>10000.50</d:AmountReceived>
<d:currencyCode>USD</d:currencyCode>

*PQR represents the Custom OData Service
myxxxxxx
and myzzzzzz represents the tenants
XYZ
and AmountReceived represents the Amount fields
USD
represents the currency code

Environment

SAP Hybris Cloud for Customer

Reproducing the Issue

For the Custom OData Service PQR

  1. Go to Administrator work center
  2. Go to OData Service Explorer view
  3. Show Custom Odata Services
  4. Highlight the Service name: PQR and select Test
  5. On the OData Console, in the left pane, select the Entity Set
  6. Select the Test tab
  7. Copy the URL available in the Request Method GET
  8. Run the query in Chrome browser

Example:

https://myxxxxxx.crm.ondemand.com/sap/c4c/odata/cust/v1/__________Collection

For the Custom OData Service PQR created before 1708 release, the result for the OData Call made in system myxxxxxx.crm.ondemand.com ,where the structure for the Amount field XYZ is as below. The data is not populating for the Amount fields.

<d:AmountReceived m:type="cust.Amount">
<d:currencyCode>USD</d:currencyCode>
<d:content>0.00000</d:content>
</d:AmountReceived>

For the Custom OData Service PQR created after 1708 release, the result for the same OData Call made in system myzzzzzz.crm.ondemand.com ,where the structure for the Amount field XYZ is as below. The data appears for the Amount fields.

<d:AmountReceived>10000.50</d:AmountReceived>
<d:currencyCode>USD</d:currencyCode>

Cause

In the OData Service Explorer, in the OData Editor for the respective Custom OData Service, the Amount is a Complex Type. Due to technical reasons, from 1708, we have stopped the user to select the Amount node at Complex level in the OData Editor.

Resolution

As the Amount is a Complex Type, you should not define it at the Complex level. It should always be at the Property level.

You cannot select Complex Type fields. Each leaf element has to be selected while Modelling.

That is, you must select leaf element of the Complex Type separately for OData Editor.

Therefore, for Custom OData Service PQR before 1708 release, you must uncheck and separately check the elements under Complex structure.

A property definition that uses a Complex Type always overrides the creatable and updatable attributes of each of the Complex Type's properties.

Keywords

Complex Type, ComplexType, Amount, Odata Editor, OData Service Explorer , KBA , complex type , complextype , amount , amount, odata editor , odata service explorer , LOD-CRM-INT-DWB , Data Workbench , Problem

Product

SAP Cloud for Customer all versions