Skip to Content
0
Jul 28, 2020 at 07:39 AM

issue with Binding Smart Table with EntitySet and tableBindingPath of the ABAP ODATA

1562 Views

Hi,

I have ABAP ODATA which i want to bind to SmartTable and please find the below code and i am getting in the screen "Right now, there are no visible columns in the table. Please select the columns you need in the table settings." and not able to bind the ABAP ODATA to SmartTable

1)Component.js

var odataModel = new sap.ui.model.odata.ODataModel("/IS4/sap/opu/odata/sap/ZPDMS_HEALTH_FORCATING_SRV", true);

this.setModel(odataModel, "ODATA");

2)In the View1.view.xml

<smartTable:SmartTable id="idSmartTableAll" tableType="ResponsiveTable" useVariantManagement="false" useTablePersonalisation="true" persistencyKey="SmartTableAnalytical_Explored" enableAutoBinding="true" demandPopin="true" useExportToExcel="false" class="sapUiResponsiveContentPadding" showFullScreenButton="true" ignoredFields="" initiallyVisibleFields="LocationName"> </smartTable:SmartTable>

3)In the View1.controller.js

onInit: function ()

{

var view = this.getView();

view.setModel(this.getOwnerComponent().getModel("ODATA"));

view.byId("idSmartTableAll").rebindTable();

}

4)When UserClicks on Go Button then the below function triggers

onPressGo:function()

{

var that = this;

var smarttable = that.getView().byId("idSmartTableAll");

smarttable.setModel("ODATA");

var network = "IND-BAN";

var url = "/health_forecastingSet?$filter=LocationName eq '" + network + "'";

smarttable.setTableBindingPath(url);

smarttable.setEntitySet("health_forecastingSet");

smarttable.rebindTable();

}