Skip to Content

Dynamically display the table data in SAPUI5 in XML View

Nov 20, 2017 at 07:55 AM


avatar image

Hi Folks,

I created a table with 12 columns and 3 rows. The data will be fetched from oData service Url.

My requirement is "All the columns should be displayed but the rows should be displayed wrt the User"

My table looks like

Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec




Now, UK, ET and GT should be displayed dynamically. Some users can see only UK, some can see only ET etc.. in all probabilities.

Help me out in solving this.



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

1 Answer

Irfan Gokak Nov 20, 2017 at 09:31 AM

Hi Sindhuja,

You can use below function and inside that function apply filters based on type of user. Use below reference code. Hope this will help.

oTable.attachEventOnce("updateFinished", function(oEvent){
	if(usertype == "<value>"){
          var oFilter1 = new Filter("<Param>", sap.ui.model.FilterOperator.Contains, "UK");
          var oFilter2 = new Filter("<Param>", sap.ui.model.FilterOperator.Contains, "GT");
	  var oBinding = this.getBinding("items");
	  oBinding.filter(new sap.ui.model.Filter([oFilter1,oFilter2], false));
10 |10000 characters needed characters left characters exceeded