Hi,
Try this
The array resultArray will contain the fetched data. len contains the number of records fetched.Make sure that the salesorderid is valid
var oModel = new sap.ui.model.odata.ODataModel("https://sapes1.sapdevcenter.com/sap/opu/odata/sap/ZCD204_EPM_DEMO_SRV",true,username,password);
oModel.read("/SalesOrders", null, ["$filter=SalesOrderID eq '0500000'"], true,
function(data, response)
{
var resultArray = [];
resultArray = data.results;
var len = resultArray.length;
alert(len);
}
function(err)
{
}
);
Regards,
Jeffin