Skip to Content
0

SAP Fiori table display not working

Jan 29, 2017 at 04:14 AM

143

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded

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

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




	}






});



0

do u have component?

0
* Please Login or Register to Answer, Follow or Comment.

3 Answers

VIPLOVE KHUSHALANI Jan 30, 2017 at 07:47 AM
0

Hi Raju ,

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

Thanks

Viplove

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Viplove, Can you please give me sample code.

0
Former Member

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.

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

Jun, it doesn't have a component.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

i think fiori needs component to work

2

is this abap fiori launchpad? or portal one?

0
Former Member

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

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

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

when you integrate flp, you need it.

0