Symptom
When querying a Purchase Order via custom OData with $expand=Notes, the request fails.
Environment
SAP Business ByDesign
Reproducing the Issue
- Go to Application and User Management work center
- Go to Odata Services view
- Select Custom Odata Services in the drop down
- Open the relevant OData
- Copy the OData link and paste it in new tab
- Remove $metadata
- Following the link :
- Use the JSON format for a structured response - ?$format=json
- Use the $filter query option to filter the Purchase Order - &$filter=ID eq 'XYZ'
- Use the $expand to retrieve related(linked) entity data - &$expand=Notes
- Select Enter.
Error appears : Error occurred while processing property 'UpdatedOn' of entity no. 6|Property 'UpdatedOn' has invalid value '0.0000000'.
Cause
The issue is caused by a data inconsistency in the Notes entity for the affected Purchase Order.
- At least one Note record for the affected Purchase Order contains an invalid value in the UpdatedOn field (example value: 0.0000000).
- OData expects UpdatedOn to be a valid date-time/timestamp format(CCYY-MM-DDThh:mm:ss(.sss)Z ) or null if not available.
- When OData expands Notes, it attempts to parse UpdatedOn. If the stored value is invalid (like 0.0000000), it throws the conversion error and the expand fails.
Resolution
- Go to Application and User Management work center
- Go to Odata Services view
- Select Custom Odata Services in the drop down
- Open the relevant OData
- Under Odata Service, expand Notes
- Locate the "UpdateOn" field
- Type: DateTimeOffset
- Path : SYSTEM_ADMINISTRATIVE_DATA-LAST_CHANGE_DATE_TIME
- Enable the Null checkbox.
Keywords
Odata; Purchase Order; Notes; $expand; UpdatedOn; Invalid value; DateTimeOffset; Custom Odata Service; Property Error; Error occurred while processing property 'UpdatedOn' of entity no. 6|Property 'UpdatedOn' has invalid value '0.0000000'; , KBA , AP-POP-PO , Purchase Order , How To
SAP Knowledge Base Article - Public