Symptom
An Error message is display while querying an Metadata.
The image/example below came from a demo instance, any resemblance to a live customer data is purely coincidental.
Environment
- SAP SuccessFactors HXM Suite
- SAP SuccessFactors Employee Central - Foundation Object
Reproducing the Issue
Important:
- Enlarge maxlength for timezone attribute in User Object
- By Default maxlength is 16 but could be enlarged to 64 "Can Not exceed 64"
Example:
- Using apache olingo library
- When calling : https://api12preview.sapsf.eu/odata/v2/$metadata
It gives following Error Message:
org.apache.olingo.odata2.api.edm.EdmSimpleTypeException: The metadata constraints '[Nullable=true, MaxLength=16]' do not match the literal 'America/Montevideo'.
Result
- describeSFObjectsResponse_user.xml
- The response contains a maxlength of 16 chars.
<Property Name="timeZone" Type="Edm.String" Nullable="true" sf:Required="true" sap:required="true" sf:Insertable="true" sap:creatable="true" sf:Updatable="true" sap:updatable="true" sf:Upsertable="true" sap:upsertable="true" sf:Selectable="true" sap:visible="true" sf:Sortable="false" sap:sortable="false" sf:Filterable="false" sap:filterable="false" MaxLength="16" sap:field-control="userPermissionsNav/timeZone" sap:label="Time Zone" />
Resolution
Step 1: Succession Data Model or SDM Configuration Change : 3066117 - How to export Data Models?
- Download Succession Data Model
- Change max-length to 64
- Import SDM
Before:
</standard-element>
<standard-element id="timeZone" max-length="16" required="true" matrix-filter="false">
<label>Time Zone </label>
</standard-element>
Modify:
</standard-element>
<standard-element id="timeZone" max-length="64" required="true" matrix-filter="false">
<label>Time Zone </label>
</standard-element>
Step 2: Refresh: Odata API Metadata Refresh : 2589774 - MDF Object Definition to DB Sync or Refresh Metadata Cache
- Go to your Instance then Admin Center
- Tool and Type: Odata API Metadata Refresh An Export
- Click on: Refresh
Step 3:Test
Query Metadata
Example: When calling : https://api12preview.sapsf.eu/odata/v2/$metadata
See Also
Keywords
Odata API Metadata Refresh timeZone, API, Metadata, maxlength, Query metadata , KBA , LOD-SF-EC-BCI , Manage Business Configuration (BCUI) & Data Models (XML) , LOD-SF-SCM-DAT , Data Model , LOD-SF-INT-API-DEPR , SFAPI Deprecation Queries , Problem