Skip to Content
0

How to Bind data coming from function import into UI5 table

Nov 23, 2016 at 07:18 AM

116

avatar image

Hi,

I'm using Function Import to get data from ABAP backend system. Data is coming into Controller.JS file.

var oUrlParams = {  
	Fznr : valf,
	StartDate : stdate,
	EndDate : endate
	};  
var oView = this.getView();  
var oModel = oView.getModel(); 
//alert(oUrlParams);
oModel.callFunction("/Krankenblatt", {  
	method:"GET",  
	urlParameters: oUrlParams,  
	success: jQuery.proxy(this.successKrankenblatt, this),  
	error: jQuery.proxy(this.errorKrankenblatt,this)  
	}); 
				
var oBindingContext = this.getView().getBindingContext();
this.doNavigate("1472123863076_S1", oBindingContext);
},
		
successKrankenblatt: function(oData) {
	var oView = this.getView();
	var oModel = new sap.ui.model.json.JSONModel(oData);
	sap.ui.getCore().setModel(oModel, "KrankenblattReport");

Now, how to bind this data ("oModel") into UI5 table and display this table in XML View.

<m:content>
			<m:Table id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103" mode="SingleSelectMaster" width="100%" noDataText="No data" backgroundDesign="Solid" showSeparators="All" growing="true" growingThreshold="20" growingScrollToLoad="true" visible="true" items="{path:'/KrankenblattReport'}" itemPress="_onTableItemPress">
				<m:items>
					<m:ColumnListItem id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-items-sap_m_ColumnListItem-1" type="Active">
						<m:cells>
							<m:ObjectIdentifier id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-items-sap_m_ColumnListItem-1-cells-sap_m_ObjectIdentifier-1" title="{ID}" text="{Avnr}" titleActive="false" visible="true"/>
							<m:Text id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-items-sap_m_ColumnListItem-1-cells-sap_m_Text-1473845841128" text="Supplier Name" width="auto" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit"/>
							<m:Text id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-items-sap_m_ColumnListItem-1-cells-sap_m_Text-2" text="Supplier Name" width="auto" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit"/>
							<m:Text id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-items-sap_m_ColumnListItem-1-cells-sap_m_Text-1473846313286" text="{KrankenblattReport>/Werk}" width="auto" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit"/>
							<m:Text id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-items-sap_m_ColumnListItem-1-cells-sap_m_Text-1473854413739" text="Supplier Name" width="auto" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit"/>
							<m:Text id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-items-sap_m_ColumnListItem-1-cells-sap_m_Text-1472210295318" text="S" width="auto" maxLines="1" wrapping="false" textAlign="Initial" textDirection="Inherit"/>
						</m:cells>
					</m:ColumnListItem>
				</m:items>
				<m:headerToolbar/>
				<m:columns>
					<m:Column id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-columns-sap_m_Column-1" width="auto" hAlign="Left" vAlign="Top" mergeDuplicates="false" minScreenWidth="Phone" demandPopin="true" popinDisplay="Inline">
						<m:header>
							<m:Text id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-columns-sap_m_Column-1-header-sap_m_Text-1" text="AV-Nr." width="auto" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit"/>
						</m:header>
						<m:footer/>
					</m:Column>
					<m:Column id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-columns-sap_m_Column-1472208830209" width="auto" hAlign="Left" vAlign="Top" mergeDuplicates="false" minScreenWidth="Tablet" demandPopin="true" popinDisplay="Inline">
						<m:header>
							<m:Text id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-columns-sap_m_Column-1472208830209-header-sap_m_Text-1" text="Aktuelle Fahrzeug" width="auto" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit"/>
						</m:header>
						<m:footer/>
					</m:Column>
					<m:Column id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-columns-sap_m_Column-3" width="auto" hAlign="Left" vAlign="Top" mergeDuplicates="false" minScreenWidth="Tablet" demandPopin="true" popinDisplay="Inline">
						<m:header>
							<m:Text id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-columns-sap_m_Column-3-header-sap_m_Text-1" text="Alte Fahrzeug" width="auto" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit"/>
						</m:header>
						<m:footer/>
					</m:Column>
					<m:Column id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-columns-sap_m_Column-2" width="auto" hAlign="Left" vAlign="Top" mergeDuplicates="false" minScreenWidth="Tablet" demandPopin="true" popinDisplay="Inline">
						<m:header>
							<m:Text id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-columns-sap_m_Column-2-header-sap_m_Text-1" text="Plant" width="auto" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit"/>
						</m:header>
						<m:footer/>
					</m:Column>
					<m:Column id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-columns-sap_m_Column-1473854406395" width="auto" hAlign="Left" vAlign="Top" mergeDuplicates="false" minScreenWidth="Tablet" demandPopin="true" popinDisplay="Inline">
						<m:header>
							<m:Text id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-columns-sap_m_Column-1473854406395-header-sap_m_Text-1" text="ShadCode" width="auto" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit"/>
						</m:header>
						<m:footer/>
					</m:Column>
					<m:Column id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-columns-sap_m_Column-1473846293976" width="auto" hAlign="Left" vAlign="Top" mergeDuplicates="false" minScreenWidth="Tablet" demandPopin="true" popinDisplay="Inline">
						<m:header>
							<m:Text id="sap_Responsive_Page_0-content-sap_m_Table-1472202795103-columns-sap_m_Column-1473846293976-header-sap_m_Text-1" text="Status" width="auto" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit"/>
						</m:header>
						<m:footer/>
					</m:Column>
				</m:columns>
			</m:Table>
		</m:content>

Thanks

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers