cancel
Showing results for 
Search instead for 
Did you mean: 

XSJS Service returns an empty JSON string

Former Member
0 Kudos

Hello Experts,

I am trying to retrieve data from a Calculation View using a XSJS service. The call to the service looks like:

jQuery.ajax({

  url : '../../../services/dealHeader.xsjs?cmd=getDealHeader_FCATemplate'+strFCAString,

  method : 'GET',

  dataType : 'json',

  success : function(data) {

  dealDataFCA = data;

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

  console.log("Deal Model FCA " + dealModelFCA);

  sap.ui.getCore().setModel(dealModelFCA,"FCADeals");

  sap.ui.getCore().setModel(dealModelFCA);

  sap.ui.getCore().getEventBus().publish("app", "DataLoadedFCA");

  graphTile.setBusy(false);

  },

  error : onErrorCall,

  async : true

  });

The above call is successful, but it does not return any data; it returns an empty JSON string... When I try to run a query on the Calculation view using the same selection parameters, it is able to give me results. I validated the code I had written in the .xsjs file, and it seems to look fine.

Can someone please guide on what I could be missing, could there be a problem in the Calculation View script?

Regards,

Divyata Dal

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Divyata,

What happens when you run this xsjs in browser ? Also could you share your xsjs code

Regards,