Steps to be followed:
- Get the instance of table sap.ui.table.Table
- Get the Binding instance using the getBinding method of table instance
- Get the path of the OData Model using the getPath method of the ODataListBinding
- Get the model instance using the getModel() method of the ODataListBinding
- The OData version is defined in the metadata. so using the getMetadata() method of the model instance, the OData version can be determined
var bindingInstance = uiTableInstance.getBinding('rows')
var sPathOfModel = uiTableInstance.getBinding('rows').getPath()
var modelInstance = uiTableInstance.getBindng('rows').getModel(sPathOfModel)
modelInstance.getMetadata() ===> This will get the sap.ui.model.odata.v2.ODataModel version.