Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Get data from OData using sapui5

$
0
0

Hi am not able to get data from server, can someone help me if I am wrong. Always I get alert as Read failed..

 

var url = "http://server:8000/sap/opu/odata/MOBPOPR/POPRAPP_SRV/ValidateApproverCollection/?$filter=Approverid eq 'supervisor' and Password eq 'welcome1'&$format=json";

var user = "mobtest";

var pass = "welcome1";

var oModel = new sap.ui.model.odata.ODataModel(url, true, user, pass); 

oModel.read(url, null, null, true, function(oData, oResponse){

oModelJson.setData(oData); 

  alert("Read successful: " + JSON.stringify(oData)); },

function(){

  alert("Read failed");});

 

 

 

The response json looks like this

 

Untitled.png


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>