Skip to Content
Feb 01, 2019 at 06:03 PM

Get value from different hana table of odata model based on a key and display in SAPUI5 table


I have table with 4 columns Customer ID,Name, Mobile No, Address and city.

Customer ID,Name, Mobile No come from "{carsModel>/customer}" table of Odata model

I have City code in the City column , I need to display City Name in that column from "{carsModel>/cities}" table of Odata model with the column "{carsModel>CITY_NAME}".

How can I acheive this.

Code for table.

<Table items="{carsModel>/customer}" noDataText="Drop column list items here and columns in the area above" id="table0" alternateRowColors="true">
<ColumnListItem type="Active" id="item0">
	<Text text="{carsModel>CUSTOMER_ID}" id="text2"/>
	<Text text="{carsModel>CUSTOMER_NAME}" id="text3"/>
	<Text text="{carsModel>MOBILE_NO}" id="text4"/>
	<Text text="{carsModel>CUSTOMER_ADDRESS}" id="text5"/>
	<Text text="{carsModel>CUSTOMER_CITY_ID}" id="text6"/>
							<Column id="column0">
									<Label text="Customer ID" id="label0"/>
							<Column id="column1">
									<Label text="Name" id="label1"/>
							<Column id="column2">
									<Label text="Mobile No" id="label2"/>
								<Column id="column3">
									<Label text="Address" id="label3"/>
									<Column id="column4">
									<Label text="City" id="label4"/>

I need to get values