Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Not able to get SAP Gateway data in Cordova Project Mobile APP

Hi Experts,

                 I am able to run my SAPUI5 Application properly, but when i integrate with Cordova Project and run it, it is not getting SAP Netweaver Gateway Data into the Mobile APP. Just the screens are being renederred without Data.

Step i followed:

1) Created an SAPUI5 Project and completed the implementation with SAP Netweaver Gateway as Gateway Server. (Successfully working).

2) Created a Cordova Project and integrated above SAPUI5 Project with it. (Just screens are seen, but no data from back-end)

Note: I am not using any proxy in calling the gateway service in Cordova Project as suggested in some documents.

Below is my code:

onInit : function() {

  var ui_model = sap.ui.getCore().getModel(

  "CommonSelDataModel");

  // this.getView().setModel(ui_model,

  // "CommonSelDataModel")

  var oController = this;

  var url = "https://www.xyz.com/sap/opu/odata/sap/XYZ_MOBILE_APP_SRV";

oDataModel = new sap.ui.model.odata.ODataModel(url,

true, "USERNAME", "PASSWORD");

  sap.ui.getCore().setModel(oDataModel, 'oDataModel');

  var fnError = function(oError) {

  };

  var fnSuccess = function(mData) {

  var oODataJSONModel = new sap.ui.model.json.JSONModel();

  oODataJSONModel.setData(mData);

  oController.getView().setModel(oODataJSONModel,

  'ProblemGroupList');

  };

  oDataModel.read("/ProblemGroupDataSet", null, null,

  false, fnSuccess, fnError);

},

Kindly help me with the same

Thanks & Regards:

Azhar

Tags:
Former Member
Former Member replied

I have done it.

Result : I was missing below statement in the index.html

<script type="text/javascript" src="cordova.js"></script>

Thanks & regards:
Azhar

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question