on 06-19-2015 4:27 PM
Hi Loh Chun Wooi,
The highlighted Line is referring to a JSON Model available at
It should be replaced with any other models that can be used in the application.
Regards
Virinchy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Virinchy, very thanks for quick respond. I know it can be replaced with any other model but may i know where can i find and fill it if i created with mock data? Is it i need to write myself or there is a file contain it that can let me copy and paste and replace the highlighted line? If yes, mind you suggest me where it is?
Second question is if i create the apps by connecting Gateway in order to expose the data in the front end, is it i need to change the highlighted row (var oModel = new sap.ui.model.json.JSONModel("test-resources/sap/viz/demokit/dataset/bookstore_fiori/ByItemCity_sum.json");)
instead of using JSON model? if yes, i am not sure whether i should change in this way (var oModel = new sap.ui.model (" ???"); )? And what parameter should i replaced with the question marks which i bold it? And where can i find it? Is it can find it in the metadata.xml which the 2 links that i highlighted?
Regards,
Loh.
not this one, you should call 1 entity set which is holds some value to display the bar chart.
And you can't use like this "new sap.ui.model (" ???"); ".
oData model, Json Model, XML Model- depending upon your requirement you should use these model.
APAIK, OData Model is used to call server side data, means to get data from server or to post data to server.
JSon Model is used for local data storage, Client side data storage purpose.
These are very basic things. Before Learn FIORI. Please have some basic knowledge on these.
Hi Loh,
In this example this link has been used.
Just use this link in place of "test-resources/sap/viz/demokit/dataset/bookstore_fiori/ByItemCity_sum.json" which is highlighted by you.
If you are using SAP Gateway then write like this.
var oModel = new sap.ui.model.odata.ODataModel("hostname: Port/sap/opu/odata/sap/ZDC_TEST_SRV/");
or if Gateway is already integrated then this might also work.
var oModel = new sap.ui.model.odata.ODataModel("/sap/opu/odata/sap/ZDC_TEST_SRV/");
In place of this.
var oDataset = new sap.viz.ui5.data.FlattenedDataset({
dimensions: [{
name: "Item Category",
value: "{Item Category}" //Entity
}, {
name: 'City',
value: '{City}' // Entity
}],
measures: [{
name: 'Revenue',
value: '{Revenue}'
}],
data: {
path: "/book" // Provide here entitySetName
}
});
In this example JSON modelhas been used. Here in Gateway oData model has been used.
Regards
Dhananjay
Write like this and check.
oDataModel = new sap.ui.model.odata.ODataModel("host:port/sap/opu/odata/sap/ZPRODUCTTEST_SRV/");)
or check with adding proxy.
oDataModel = new sap.ui.model.odata.ODataModel("proxy/https/**********:port/sap/opu/odata/sap/ZPRODUCTTEST_SRV/");)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Loh,
If you have got the answer then Please mark this Discussion with a Correct Answer (closes, but does not lock the Discussion) and Helpful Answer where appropriate. Seehttp://scn.sap.com/community/support/blog/2013/04/03/how-to-close-a-discussion-and-why Even if you discovered the solution without any outside contributions, it helps others to understand what the solution turned out to be. Do not use Assumed Answered as it confuses anyone looking for the specific answer.
Thanks, Dhananjay
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.