Leverage SAPUI5 to consume data from MySQL

Home » SAPUI5 » Leverage SAPUI5 to consume data from MySQL
April 4, 2018 SAPUI5 No Comments

SAP’s answer to enhanced user experience began by introducing SAP Fiori which is based on SAPUI5 – the technology behind, which is a combination of HTML5,CSS3,XML and JavaScript.

SAPUI5 can exchange data using XML HTTP Request object to call complete datasets from the backend systems. But SAPUI5 controls are optimized to exchange data using the open data OData protocol, also known as ‘The SQL of the Web’. SAP has chosen OData as the de facto standard for all SAP solutions. Having said that, the possibilities with UI5 are limitless and it’s possible to integrate SAPUI5 with various JavaScript libraries and protocols. One can easily integrate any REST API with UI5 and create stunning applications.

Let’s deep dive and see how easy it is to integrate data from MySQL database with a UI5 application. Below data is available in a MySQL instance,

We will create a simple UI5 application and try to display the data in a table using the sap.m.Table control.

We have now created a simple XML view using the sap.m.Table control and bound the items aggregation to a JSON model. The JSON model is sourced via API call to fetch data from MySQL database.

This is just a demonstration to showcase the capabilities of UI5 and its seamless integration with external data. The same approach can be leveraged to integrate data from Oracle,MSSQL etc where consumption/creation of OData services is not a feasible option.