Hello Experts,
Can I create an Odata service which will return me the following json format, without using association and navigation?
If yes, request you to please suggest how could I achieve that.
{ "category" : [ { "dkey" : "01", "dtext" : "Zero One" , "subCategory":[{ "dkey":"A", "dtext":"Alfa A" }] }, { "dkey" : "02", "dtext" : "Zero Two" , "subCategory":[{ "dkey":"B", "dtext":"Beta B" },{ "dkey":"G", "dtext":"Gama G" },{ "dkey":"D", "dtext":"Delta D" }] } ] }
Warm regards,
Upendra
Upendra,
You cannot use OData to get exactly like this, I would not prefer using OData as well.
OData has its own data model restrictions/rules and I do not think it suits here.
Rather, I would suggest using generic rest classes and create a generic icf service.
You may check this for ideas.
JSON Adapter for ABAP Function Modules
Regards
Krishna
Add a comment