Skip to Content
0

how pass in multiple parameters as entity on xsodata call?

Jan 10, 2017 at 08:57 PM

173

avatar image

I have a calc view that I need to call and pass in multiple parameters in order to retrieve the data. I have done it for a different one but only passing a single parameter. How can I do it using multiple ones?

this is how I make the oData call in my controller.

var dataURL = "urlTo .xsodata file";

var oModel = new sap.ui.model.odata.ODataModel(dataURL, true);
var products = new sap.ui.model.json.JSONModel();

oModel.read("/input('"+input+"')/Results/", null, null, true, function(oData){
   products.setData(oData.results);
});

this.getView.setModel(products);

This is my .xsodata file

service napespace "_SYS_BIC"{
 "calc View Name" as "PricingTool"
 parameters via entity "input"
 results property "Results";
}

How can I take this and allow for more inputs?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Tim Champagne Feb 15, 2017 at 05:51 PM
0

Do you want to pass multiple input parameters or further filter the results based on columns? I also have a xsodata service pointed to a calc view with a single input parameter. When I bind my model to a UI5 table I also pass filters as well.

sap.ui.getCore().byId("EACInputTable").bindRows({
            path: "EACInput>/InputParams(IP_START_DATE=datetime'"+timephase_period+"')/Results",
            template: columnList,
            sorter: aSort,
            filters: oFlterAnd
        });
Share
10 |10000 characters needed characters left characters exceeded