cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

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

Answers (0)