on 04-02-2013 3:42 PM
Hi,
I'm making an ABAP Web Dynpro where an user can extract some data as an Excel spreadsheet (XLS or XLSX format).
I have the data in an internal table.
I would like to generate a valid Excel file (i.e. not a CSV with an XLS extension, if that is possible) by taking a subset of the columns of my internal table and using a custom header line (i.e. the headers should not be taken from the data domain - e.g.: field with type Datum should show "First day" instead of the generic "Date").
The resulting Excel file should then be offered to the user to be downloaded.
Can someone suggest me a way to achieve that?
Let me know if what I've written isn't clear.
Thanks!
Pietro
Hi Pietro,
you could try implementing an ALV table with your data, it directly offers an "export to xls" button which could make your job easier... I think you could the customize the standard behaviour from there.
Check out this tutorial to make an ALV table within a WD application: http://www.sapdev.co.uk/sap-webapps/sap-webdynpro/wdp-alv.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are multiple approaches, as far as I've seen.
Have a look at the following tutorial:
http://saptechnical.com/Tutorials/WebDynproABAP/Export/toexcel3.htm
(I linked the third page as it contains a sketch of code which could help you, but you'd better read the whole article).
This is imho the simplest approach.
The following one is a bit more complicated as it builds up an XML (quite verbose) :
http://scn.sap.com/docs/DOC-25024
Hope it helps
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.