首页 > SAP > SAPUI5 > Download data in excel in SAPUI5 Application
2019
08-27

Download data in excel in SAPUI5 Application

Hello everyone, In this tutorial we will show you how to download data in excel in SAPUI5 Application.

1.Prerequisites

You should have SAP Netweaver Gateway Server on Netweaver 7.40 release.
You should have a SAP Netweaver Gateway service ready with you. Click here.
You should have a basic understanding of SAPUI5 Application and Netweaver Gateway OData Service.

2.Step-by-Step Procedure

Export data into excel in SAPUI5 application.

1. Open Eclipse IDE and create a SAPUI5 Application project by clicking on File → New → Project. Choose Application Project under SAPUI5 Application Development.

2. Click on Next and provide the Project Name, choose sap.m library and hit Next to create a initial view.

3. Provide the view name and choose type of the view as Java Script.Here you can choose any of the option as per your preference and hit Next to create project.

4. A new SAPUI5 project is created in Project Explorer.

5. Select index.html file in the project and double click to appear in the workbench window.Copy and paste the below code in the index.html file (or) adjust the code as per the below code.

Index.html

6. Now double click on the demoTable.view.js to create and add Table inside the View. All the UI element controls should be placed in the CreateContent( ) method of the view. Add the below code to create a Table and columns of the table in the view.

demoTable.view.js

7. Now double click on demoTable.controller.js to call the OData service url to get the data from the backed and also the code to download the table data in excel.

demoTable.controller.js

8. We are ready with application. Save the application and deploy it in SAPUI5 ABAP Repository.To know the steps on how to deploy SAPUI5 application to ABAP Repository click here.

9. After deployment of the application its time to test the URL.The URL of the SAPUI5 application will look like below.

http://<server_name>:8000/sap/bc/ui5_ui5/sap/<application_name>/index.html?sap-client=300

[adsenseyu1]

For Example:
http://saplearners.com:8000/sap/bc/ui5_ui5/sap/ztest_download/index.html?sap-client=300

10. If every thing is working fine, you should see the below output.

11. Now click on the Download button to download the table data into excel.

12. Open the excel file downloaded.

You have successfully created a SAPUI5 Application to download data in excel.

Please stay tuned to us for more SAPUI5 Tutorials. Please feel free to comment and let us know your feedback. You feedback will keep us alive.

Thank you.

最后编辑:
作者:yangsen
本站为个人博客网站,全由我个人维护,记录工作学习过程, 有SAP相关询问专、兼职工作可随时联系我。 有网站相关的问题可直接在文章下方留言,或者联系我。 邮件:yan252@163.com给我。 QQ:415402519

留下一个回复

你的email不会被公开。

8 + twelve =