Symptom
You have created a Custom OData Service and you have added the ExpenseReportCollection entity to your service, but when you try to run a POST (create) on this entity, you get the below errors and the record is not created.
Errors are:
- 'Create not allowed for properties: EmployeeID. Check metadata for ExpenseReportCollection'
- 'Employee ID missing::No calculation of settlement results due to inconsistent entries. Please correct the errors.::Expense arrangement not found'
Environment
SAP Business ByDesign
Reproducing the Issue
-
Using a tool of your choice, perform the POST using the ExpenseReportCollection.
- Error is thrown: 'Create not allowed for properties: EmployeeID. Check metadata for ExpenseReportCollection'.
- Now remove Employee ID from the payload and run again.
- Error is thrown: 'Employee ID missing::No calculation of settlement results due to inconsistent entries. Please correct the errors.::Expense arrangement not found'.
Cause
Error 'Create not allowed for properties: EmployeeID. Check metadata for ExpenseReportCollection' is thrown because the Employee ID property is not enabled for creation, as seen in the service's metadata (creatable = "false").
Error 'Employee ID missing::No calculation of settlement results due to inconsistent entries. Please correct the errors.::Expense arrangement not found' is thrown because the OData Entity does not allow creation of expense reports. The logic used here means that expense reports can only be created through the UI. Web services also do not allow this creation, in fact there is no web service available for expense Reports.
Resolution
At this time, the functionality does not allow for creation of expense reports through OData.
See Also
Keywords
OData, Finance , KBA , SRD-FIN-ERM , Travel and Expense Management , AP-RC-ODF , OData framework (C4C Only) , How To