cancel
Showing results for 
Search instead for 
Did you mean: 

How To create additional tabs in excel when the data is been exported through odata service?

shiva_krishna93
Explorer
0 Kudos

Hi,

i have an requirement that i am exporting the data from SAP in the form of excel through odata service .I need to create 3 tabs in the excel where i have to export the data in those 3 tabs.Can you please suggest how to create those?

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184867
Active Contributor
0 Kudos

What you you mean by "exporting the data from SAP in the form of excel through odata service " ?

shiva_krishna93
Explorer
0 Kudos

hi Mallik,

I have some data in an internal table , that data I have to display to the user in the form of excel.To be more specifc when user clicks on download button in frontend this data will be downloaded as an excel in which I have create 3 sheets in it.

Regards,

Shiva

former_member184867
Active Contributor
0 Kudos

First of all OData is not a mechanism to transfer data in form of Excel rather it is just a mechanism to transfer data. By nature OData does not come with any excel manipulation mechanism.

However Gateway Server adds a 'LITTLE' excel capability to the OData Response. Gateway can send the response Entity Set in Excel attachment if you pass '$format=xlsx' in the URL. But this is out of the box from Gateway.

Refer to Excel Support - SAP Gateway Foundation (SAP_GWFND) - SAP Library for the limitations.

SAP UI SmartTable control also offers you to download the content of the table if

is set. However this internally uses the Gateway feature.

Refer to

https://sapui5.netweaver.ondemand.com/docs/api/symbols/sap.ui.comp.smarttable.SmartTable.html

But this allows you to download the content of one table in one excel tab.

These are the options available for you out of the box but they do not create 3 tabs for you, rather they download  one excel for one one entityset/one table.

For your requirement you may go for custom control or using third party apis like

https://github.com/SheetJS/js-xlsx

http://excelbuilderjs.com/.

In this case you need to make OData calls to get the data from backed  and collate them in json format in JavaScript, and then converting it to excel using the js libraries.