since the variables declared(idno, namecity) are inside parentheses I could not access them out side. Is this the way to get values or which would be the best way. Thank You
<script>
var app = sap.m.App("myApp",{});
var url = "proxy/http/server/ZCUST_TESTING_SRV /?$filter=IKunnr eq '800COL101'";
var username = "mobtest";
var password = "welcome1";
var oModel = new sap.ui.model.odata.ODataModel(url, true, username, password);
oModel.read('/', null, null, true, function(oData, oResponse)
{
var dataget = JSON.stringify(oData);
var count = oData.results[0].Ort01;
var namecity= oData.results[0].Name1;
var idno= oData.results[0].Kunnr;
});
var l4 = new sap.m.Label("l4",{text: count});
var l5 = new sap.m.Label("l5",{text: namecity});
var l6 = new sap.m.Label("l6",{text: idno});
var page = new sap.m.Page("page",{
title:"Address Details",
showNavButton:true,
navButtonTap: function(){
//app.back();
app.to("Page");
},
content: [ l4,l5,l6, new sap.m.Button({text:"submit" }})]
});
app.addPage(page);
app.placeAt('content');
</script>