on 2025 Feb 21 9:13 AM
Hi all,
I'm trying an upsert to a custom CBO but the expected types are sort of strange.
It does not accept the values a GET request response.
Also numeric is not accepted as '1.00' but 1.00m
Example for the error:
CheckBox = true is not considered as boolean, nor is 'true' or 'X' or 1 or whatever.
Has anyone solved this?
Request clarification before answering.
Hello @RWeidner
Your call is failing because the CBO sap_upsert must be invoked with POST and a JSON body, not by passing parameters in the URL. When you include parameters in the query string, the gateway treats them as strings, leading to the error Expected type is Edm.Boolean.
What to do (works reliably in Public Cloud):
Call the function import with POST + JSON
POST /sap/opu/odata/sap/YY1_API_TEST_CDS/YY1_API_TESTSap_upsert
Content-Type: application/json
Accept: application/json
{
"NumericID": "0000000001",
"CheckBox": true,
"Amount": 1.00
}
If you only want to quick-test via URL (GET)
.../YY1_API_TEST_CDS/YY1_API_TESTSap_upsert?
NumericID='0000000001'&CheckBox=true&Amount=1.00M
Double-check names and types in $metadata
Open the service $metadata and verify the FunctionImport parameter names and EDM types match what you send. If the parameter name differs from the entity field name, you must use the function import’s parameter name. odata.org-Operations (OData Version 2.0)
With kind regards
Chuma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 18 | |
| 6 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.