on 01-14-2016 6:14 AM
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.
Regards
Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello! Did you find a decision how create same your json model on sap service?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I followed Krishna's suggestion and used the JSON Adapter for ABAP Function Modules.
Please check the above blog. It's exactly what I was looking.
Hello Upendra,
As far as i know its not possible with out creating association & navigation between the entities.
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
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.