Hello,
I have to set up an ODataModel for one of my tables. While I had some experience with JSONModel and XMLModel, this is the first time that I need to use the ODataModel.
What I have right now, it's a simple MDOQuery template that returns the entries from a database table . While for a really simple JSONMdel, I would use the Illuminator service with the QueryTemplate set to my MDOQuery file path, like this:
var oModel= sap.ui.model.json.JSONModel();
oModel.loadData("/XMII/Illuminator?QueryTemplate=path/to/my/MDOQuery&Content-Type=text/json");
I have issues, achieving the same thing for a ODataModel.
Now, starting with the 14.0v, there is an OData service for running query templates, as seen here:
http://help.sap.com/saphelp_mii140sp02/helpdata/en/44/2e1d2d42994aef85ef91e58db8c7c9/content.htm
Based on this documentation, I tried to create an sap.ui.mode.odata.ODataModel similar to how I create the client-side models like JSON,XML:
var odataModel = new sap.ui.model.odata.ODataModel("/XMII/IlluminatorOData/QueryTemplate?QueryTemplate=path/to/my/MDOQuery");
When using this approach, the following error it's logged on the console:
GET http://<server>:<port>/XMII/IlluminatorOData/QueryTemplate/$metadata?QueryTemplate=path/to/my/MDOQuery 500 (Internal Server Error)
As a constructor parameter, the ODataModel, expects an service url, so I'm not really sure that my approach it's correct. Would it be possible to initialize and ODataModel like this?
Thank you.