cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Fiori table display not working

Former Member
0 Kudos

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.

junwu
Active Contributor
0 Kudos

your code.............

Former Member
0 Kudos

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');




	}






});



junwu
Active Contributor
0 Kudos

do u have component?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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

junwu
Active Contributor
0 Kudos

when you integrate flp, you need it.

Former Member
0 Kudos

Jun, it doesn't have a component.

junwu
Active Contributor

i think fiori needs component to work

junwu
Active Contributor
0 Kudos

is this abap fiori launchpad? or portal one?

Former Member
0 Kudos

I guess Jun is right. Can you try adding Component.js and see?

former_member340030
Contributor
0 Kudos

Hi Raju ,

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

Thanks

Viplove

Former Member
0 Kudos

Hi Viplove, Can you please give me sample code.

Former Member
0 Kudos

If that was the case, i think it would have failed in when Raju tried that as a SAPUI5 standalone app. Please correct me if i am wrong.