Skip to Content
avatar image
Former Member

SAP Fiori table display not working

Hello Gurus,

I developed a SAP UI5 application that pulls data from SAP and displays in the browser (using gateway and sap.m.table). It worked as expected, I see the back end table entries in the browser. When I launch this application in Fiori, I only see only table column names and it is saying "no data". I followed standard steps to launch it (creation of launch pad with URL, semantic object, role, catalog & group ) Can you please help me?

-Raj.

Add comment
10|10000 characters needed characters exceeded

  • your code.............

  • Former Member
    View:
    sap.ui.jsview("empcrud5.EmpDetails", {
    
    
    	/** Specifies the Controller belonging to this View. 
    	* In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.
    	* @memberOf empcrud5.EmpDetails
    	*/ 
    	getControllerName : function() {
    		return "empcrud5.EmpDetails";
    	},
    
    
    	/** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed. 
    	* Since the Controller is given to this method, its event handlers can be attached right away. 
    	* @memberOf empcrud5.EmpDetails
    	*/ 
    	createContent : function(oController) {
    		oController.loadModels();
    		var oTable = new sap.m.Table({
    			id: "Employees",
    			itemPress : [ oController.ItemPress,oController ],
    			columns: [
    			          new sap.m.Column({
    			        	  width: "1em",
    			        	  header: new sap.m.Label({
    			        		  text: "Emp ID"  }) }),
    			        		  new sap.m.Column({
    			        			  width: "1em",
    			        			  header: new sap.m.Label({
    			        				  text: "Name" })
    			        		  }),
     			        		  new sap.m.Column({
     			        			  width: "1em",
     			        			  header: new sap.m.Label({
     			        				  text: "Address"
     			        			  })
     			        		  }),
    			        		  new sap.m.Column({  
     			        			  width: "1em",
     			        			  header: new sap.m.Label({
     			        				  text: "Designation"
     			        			  })
     			        		  })
    			          ],
    			          items :{
    			        	  path: '/EmployeeSet',
    			        	  template: new sap.m.ColumnListItem({
    			        		  cells: [
    			        		          new sap.m.Label ({
    			        		        	text:'{Empid}'
    			        		          }),
    			        		          new sap.m.Label ({
    				        		        	text:'{Empname}'
    				        		          }),  
    				        		          new sap.m.Label ({
    					        		        	text:'{Empadd}'
    					        		          }),
    					        		          new sap.m.Label ({
    						        		        	text:'{Empdes}'
    						        		          })
    			        		          ]	
    			        	  })
    			          }
    		}).setModel(sap.ui.getCore().getModel('idModel') );  
     		return new sap.m.Page({
    			title: "Employee Details",
    			content: [
    			          	oTable
    			]
    		
    		}); 
     		 
     		     }
    
    
     		});
    
    
    Controller:
    
    sap.ui.controller("empcrud5.EmpDetails", {
    	
    
    
    	loadModels:function(){ 	
    		var model = new sap.ui.model.odata.ODataModel('http://XXXXXXXXXXXXXXX/sap/opu/odata/SAP/ZCM_EMP_SRV/');
    
    
    		sap.ui.getCore().setModel(model,'idModel');
    
    
    
    
    	}
    
    
    
    
    
    
    });
    
    
    
    
  • do u have component?

  • Get RSS Feed

3 Answers

  • Jan 30, 2017 at 07:47 AM

    Hi Raju ,

    Can you set the model of oTable in the controller after the oData request instead of attaching it globally.

    Thanks

    Viplove

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 30, 2017 at 04:52 PM

    Jun, it doesn't have a component.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 02, 2017 at 04:00 PM

    I believe Component.js is not mandatory to create a Fiori app.

    Add comment
    10|10000 characters needed characters exceeded