a month ago
Hello Experts,
I have this JSON Post in Odata
{
"brand" : "ShopRite",
"fundingType" : 10,
"offerCode" : "25041101",
"gs1CoPrefix" : "",
"familyCode" : "0",
"offerSeries" : "1",
"manufacturerCodes" : [ "text", "text2" ],
"taxesReclaimable" : false,
"isTender" : false
}
manufacturerCodes is the array expected by the client.
How can we configure and implement a system to handle arrays in SEGW for OData? I know there are complex types or Collection types in V4, but those require a property (the sub-object has a field label like)
"manufacturerCodes" : [ code: "text",
code "text2" ]
or
"manufacturerCodes" : [ { code: "text", }
{ code: "text2" }
],
Any idea? Is there any standard approach to post a field with an array to SAP OData?
If we post, I'm having this error: "error while parsing an XML stream". Already tried using a collection or complex type.
Please
Thanks a lot for your time to help
Request clarification before answering.
Hello,
if you can use oData V4, you can define a property as collection of Edm.String (Have a look at the answer there: https://community.sap.com/t5/technology-q-a/post-array-in-single-field-via-odata-service/qaq-p/12485...).
I don't think it is possible to do it with oData V2 and SEGW in a "standard way". If you can change the incoming JSON format, you can stringify the array (or just use a comma separated string) and parse it on the ABAP side as workaround, or use an association to a new entity for "manufacturerCodes" (with the downside of needing a "code" property there, too).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
8 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.