Symptom
When executing a Payload in OData Console, you get the below error:
Unknown error. Please check the metadata and try again!
Environment
SAP Cloud for Customer
Reproducing the Issue
- Go to Administrator work center
- Go to OData Service Explorer
- Select the OData service 'c4codataapi'
- Select Test
- Select the RegisteredProductCollection
- Go to the Test tab
- Select the 'Post' method
- Add the attached xml file to the payload
- Select 'Execute'
You get the mentioned error.
Cause
Creation of complete BO (Registered product) with multiple nodes is not allowed in the console.
"Registered Product" OData service is based on multiple nodes. For creation "Customer" party is mandatory, which is present in a different node.
Since data in OData console is regarding only the Root, whenever you try to create the data, it results in an error.
You need to provide all mandatory information which might be present in a node different than Root, which is not possible through Odata Console.
Resolution
In order to create/test Registered Product using OData, use Postman or any other REST based API testing software.
For sample payload for Postman refer the below:
{
"ID":"yyy",
"SerialID":"zzz",
"ProductID":"abc",
"Status":"4",
"ReferenceDate":"20181023000000",
"RegisteredProductPartyInformation":[
{
"PartyID":"xxx",
"RoleCode":"60"
}
],
"RegisteredProductDescription":[
{
"Description":"Reg prod TEST SAP",
"languageCode":"EN"
}
]
}
Where yyy, zzz, abc, xxx represents the ID, Serial ID, Product ID and Party ID respectively.
Keywords
metadata, OData, RegisteredProduct, c4codataapi , KBA , LOD-CRM-INT-API , OData API (C4C Only) , Problem