on 03-23-2017 8:45 AM
i wan to manipulate odata data,so I want to make the odata to array to manipulate.For example i want to check the key data i inseted whether repetition.
i want to make odata data to array,but i don`t binding list or table .i just want to operate it in controller.
Whenever you read from odata, the output you get is in the form of array of objects.
this._model.read("/yourEntitySet",null,null,false,function(oData){
console.log(oData.results); //oData.results is an array
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
oModel.read("/EntitySet", {
success: function(oData){
//here you can assign the data to your array from the oData parameter
}
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Jingquan,
you need to define your oData model in your controller and then you can call your service inside that model.
var sServiceUrl = "/sap/opu/odata/sap/OData_proj_name_SRV"; //OData_proj_name_SRV is your odata srv project name
var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl, true);
oModel.read("/EntitySet",{
sucess:function(oData){
console.log(oData).
//here you can see your odata service output in console prompt of you browser. Accordingly you can modify that based //on your requirement.
}
});
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.