cancel
Showing results for 
Search instead for 
Did you mean: 

“No data” in your SAPUI5 table

gkanwa
Discoverer
0 Kudos

Hello All,

Data is coming from backend by odata service and I can see in the console but it is not getting displayed in Table in UI.

{
	"_version": "1.5.0",
	"sap.app": {
		"id": "EOA_Screen",
		"type": "application",
		"i18n": "i18n/i18n.properties",
		"applicationVersion": {
			"version": "1.0.0"
		},
		"title": "{{appTitle}}",
		"description": "{{appDescription}}",
		"sourceTemplate": {
			"id": "servicecatalog.connectivityComponent",
			"version": "0.0.0"
		},
		"dataSources": {
			"BBS_AIF_SERVICE_SRV_02": {
				"uri": "/sap/opu/odata/BBS_AIF_SERVICE_SRV_02/",
				"type": "OData",
				"settings": {
					"odataVersion": "2.0",
					"localUri": "localService/BBS_AIF_SERVICE_SRV_02/metadata.xml"
				}
			}
		}
	},
	"sap.ui": {
		"technology": "UI5",
		"icons": {
			"icon": "",
			"favIcon": "",
			"phone": "",
			"phone@2": "",
			"tablet": "",
			"tablet@2": ""
		},
		"deviceTypes": {
			"desktop": true,
			"tablet": true,
			"phone": true
		},
		"supportedThemes": ["sap_hcb", "sap_belize"]
	},
	"sap.ui5": {
		"handleValidation": true,
		"rootView": {
			"viewName": "EOA_Screen.view.App",
			"type": "XML"
		},
		"dependencies": {
			"minUI5Version": "1.30.0",
			"libs": {
				"sap.ui.core": {},
				"sap.m": {},
				"sap.ui.layout": {},
				"sap.ushell": {},
				"sap.collaboration": {},
				"sap.ui.comp": {},
				"sap.uxap": {}
			}
		},
		"contentDensities": {
			"compact": true,
			"cozy": true
		},
		"models": {
			"i18n": {
				"type": "sap.ui.model.resource.ResourceModel",
				"settings": {
					"bundleName": "EOA_Screen.i18n.i18n"
				}
			},
			"": {
				"type": "sap.ui.model.odata.v2.ODataModel",
				"settings": {
					"defaultOperationMode": "Server",
					"defaultBindingMode": "TwoWay",
					"defaultCountMode": "Request"
				},
				"dataSource": "BBS_AIF_SERVICE_SRV_02",
				"preload": true
			}
		},
		"routing": {
			"config": {
				"routerClass": "sap.m.routing.Router",
				"viewType": "XML",
				"async": true,
				"controlId": "app",
				"controlAggregation": "pages",
				"viewPath": "EOA_Screen.view",
				"bypassed": {
					"target": "notFound"
				}
			},
			"routes": [{
				"pattern": "",
				"name": "Login",
				"target": "Login"
			}, {
				"pattern": "overview",
				"name": "overview",
				"target": "overview"
			}, {
				"pattern": "detail",
				"name": "detail",
				"target": "detail"
			}],
			"targets": {
				"Login": {
					"viewName": "Login",
					"viewLevel": 1,
					"viewId": "IdLogin",
					"transition": "fade"
				},
				"overview": {
					"viewName": "Overview",
					"viewLevel": 2,
					"viewId": "IdOver",
					"transition": "fade"
				},
				"detail": {
					"viewName": "Detail",
					"viewLevel": 3,
					"viewId": "IdDetail",
					"transition": "flip"
				}
			}
		},
		"resources": {
			"css": [{
				"uri": "css/style.css"
			}]
		}
	}
}
<!DOCTYPE HTML>
<html>

	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta charset="UTF-8">

		<title>EOA_Screen</title>

		<script id="sap-ui-bootstrap"
			src="../../resources/sap-ui-core.js"
			data-sap-ui-libs="sap.m"
			data-sap-ui-theme="sap_belize"
			data-sap-ui-compatVersion="edge"
			data-sap-ui-xx-bindingSyntax="complex"
			data-sap-ui-preload="async"
			data-sap-ui-resourceroots='{"EOA_Screen": "./"}'>
		</script>

		<link rel="stylesheet" type="text/css" href="css/style.css">

		<script>
			sap.ui.getCore().attachInit(function() {
				new sap.m.Shell({
					app: new sap.ui.core.ComponentContainer({
						height : "100%",
						name : "EOA_Screen"
					})
				}).placeAt("content");
			});
		</script>
	</head>

	<body class="sapUiBody" id="content">
	</body>

</html>
<mvc:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:html="http://www.w3.org/1999/xhtml"
	xmlns:l="sap.ui.layout" xmlns:f="sap.ui.layout.form" controllerName="EOA_Screen.controller.Overview">
	<Page title="Select Application">
		<Table id="idHTable" items="{ path: '/Get_listSet' , parameters: { 'expand' : 'approval_hdr_assoc_nav'}}"
			class="sapUiResponsiveMargin" width="auto">
			<headerToolbar>
				<Toolbar height='auto'>
					<VBox class="sapUiSmallMargin">
						<RadioButtonGroup id="rbg1" columns="3" select="onSelectRb">
							<RadioButton text="Tick the boxes individually or combined"/>
							<RadioButton text="completed approvals but still in progress" id="Completedtasks"/>
							<RadioButton text="completed approvals during the last 30 working days" id="Completedworkflows"/>
						</RadioButtonGroup>
						<VBox id="CheckVboxGroup" visible="true" class="sapUiMediumMarginBegin">
							<CheckBox xmlns="sap.m" id="Tasksofrepresented" select="checkTasksofrepresented" text="open approvals where I am representative/proxy"/>
							<CheckBox xmlns="sap.m" id="Mytasks" select="checkMytasks" text="my open approvals" selected="true"/>
						</VBox>
						<SearchField search="onFilterDocuments" width="50%" placeholder="Search SAP document number" class="sapUiSmallMarginBegin"/>
					</VBox>
				</Toolbar>
			</headerToolbar>
			<columns>
				<Column id="__column1" width='4rem'>
					<Text text="System"/>
				</Column>
				<Column id="__column2">
					<Text text="Plant"/>
				</Column>
				<Column id="__column3">
					<Text text="SAP Document Number"/>
				</Column>
				<Column id="__column4">
					<Text text="Order Type"/>
				</Column>
				<Column id="__column5">
					<Text text="Vendor"/>
				</Column>
				<Column id="__column6">
					<Text text="Vendor Number"/>
				</Column>
				<Column id="__column7">
					<Text text="Purchasing Group"/>
				</Column>
				<Column id="__column8">
					<Text text="Purchasing Group Name"/>
				</Column>
				<Column id="__column9">
					<Text text="Value"/>
				</Column>
				<Column id="__column10">
					<Text text="Resposible for task"/>
				</Column>
				<Column id="__column11">
					<Text text="Workflow Status"/>
				</Column>
				<Column id="__column12">
					<Text text="Attachment"/>
				</Column>
				<Column id="__column13">
					<Text text="Transaction"/>
				</Column>
				<Column id="__column14">
					<Text text="Other Info"/>
				</Column>
			</columns>
			<items>
				<ColumnListItem>
					<cells>
						<!--For Property binding "/" must be prefixed-->
						<Text text="{/system}" id="__text1" wrapping="false"/>
						<!--<Text text="{/approval_hdr_assoc_nav>plant}" id="__text2" wrapping="false"/>-->
						<!--<Text text="{/doc_no}" id="__text3" wrapping="false"/>-->
						<!--<Text text="{order_type}" id="__text4" wrapping="false"/>-->
						<!--<Text text="{vendor_name}" id="__text5" wrapping="false"/>-->
						<!--<Text text="{Vendor_no}" id="__text6" wrapping="false"/>-->
						<!--<Text text="{purch_grp}" id="__text7" wrapping="false"/>-->
						<!--<Text text="{Purch_grpname}" id="__text8" wrapping="false"/>-->
						<!--<Text text="{value_currency}" id="__text9" wrapping="false"/>-->
						<!--<Text text="{resp_for_task}" id="__text10" wrapping="false"/>-->
						<!--<Button type="Accept" press="onPressApproved" text="{wf_status}"></Button>-->
						<!--<Button icon="sap-icon://attachment" press=".onClickAttachment"/>-->
						<!--<Button icon="sap-icon://sap-logo-shape" press=".onPressSapLogo"/>-->
					</cells>
				</ColumnListItem>
			</items>
		</Table>
	</Page>
</mvc:View>
sap.ui.define([
	"sap/ui/core/mvc/Controller",
	"sap/ui/core/Fragment",
	'sap/ui/model/json/JSONModel'
], function(Controller, Fragment, oEvent, JSONModel) {
	"use strict";

	return Controller.extend("EOA_Screen.controller.Overview", {
		onSelectRb: function() {
			var that = this;
			//Start------RadiButton Handling-------
			var oVBox = this.getView().byId("CheckVboxGroup"),
				oRBGroup = this.getView().byId("rbg1"),
				iIndex = oRBGroup.getSelectedIndex();
			if (iIndex === 0) {
				oVBox.setVisible(true);
				//Fetch which checkbox is selected
			} else {
				oVBox.setVisible(false);
				if (iIndex === 1) {

				}
				if (iIndex === 2) {

				}
			}
			//End------RadiButton Handling---------
			//Start----------------------------------Odata Read Operation------------------------------
			//1. access OData model declared in manifest.json file
			var oModel = this.getOwnerComponent().getModel();
			//3. Create a JSON Model
			oModel.read(
				"/Get_listSet(IvCompletedtasks='',IvCompletedworkflows='',IvDocNumber='',IvLtpatoken='005056B73FFE1EDCB2BA5CA49C6A3851',IvMytasks='X',IvTasksofrepresented='X',IvApplication='YMPR',IvFrom=1,IvTo=10)", {
					urlParameters: {
						"$expand": "approval_hdr_assoc_nav"
					},
					success: function(oData, oResponse) {
						that.getView().setModel(oModel);
						sap.m.MessageToast.show("Data to display");
					},
					error: function(oError) {
						// Read error message & Display them on screen.
						sap.m.MessageToast.show("No data to display");
					}
				});
			//End-----------------------------Odata Read Operation----------------------------------------
		}
	});
});
rahulkumar_sankla
Participant
0 Kudos

can you share the metadata of the service?

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos
/Get_listSet(IvCompletedtasks='',IvCompletedworkflows='',IvDocNumber='',IvLtpatoken='005056B73FFE1EDCB2BA5CA49C6A3851',IvMytasks='X',IvTasksofrepresented='X',IvApplication='YMPR',IvFrom=1,IvTo=10)

this kind of thing should be in your binding, your manual odata call is pointless.

why all the cells are commented out?