on 05-24-2019 6:21 PM
for the below payload Im getting the following error:
{
“ProductID”: “AD-1000”,
“TypeCode”: “AD”,
“Category”: “Computer system accessories”,
“Availability_Status”: “Out of stock”,
“Name”: “Portable DVD player”,
“NameLanguage”: “EN”,
“Description”: “Flyer for our product palette”,
“DescriptionLanguage”: “EN”,
“SupplierID”: “0100000000”,
“SupplierName”: “SAP”,
“TaxTarifCode”: “1”,
“MeasureUnit”: “EA”,
“CurrencyCode”: “EUR”,
“WeightMeasure”: “4.9M”
}
{
“error”: {
“code”: null,
“message”: “Error while deserializing payload. An error occurred during deserialization of the entity. A JSON number is not supported as Edm.Decimal value.”
}
}
WeightMeasure is of type WeightMeasure : Decimal(13, 3);
Could you please help me here?
Thanks in advance
Ashish
Hi Ashish,
Property Values of type Odata EDM.Decimal and EDM.Int64 must be of type JSON Strings and not Number. Reason is that the value range of EDM.Decimal and JSON Number is larger than JavaScript Number. This avoids data loss during the parsing step.
Regards Oliver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you have an example of how could I specify it's a JSON String? My payload currently is:
{
"secuence": 1,
"flagDel": false,
"datePro": "2020-02-26",
"datePay": "2020-02-26",
"payAmt": "2.00",
[...]
}
And the response is:
{
"error": {
"code": null,
"message": "Error while deserializing payload. An error occurred during deserialization of the entity. A JSON number is not supported as Edm.Decimal value."
}
}
Thanks
You might want to check my follow-on question https://answers.sap.com/questions/12991667/how-to-format-edmdecimals-in-postputpatch.html
Klaus
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.