Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Download an ABAP report output into a true Excel file

Former Member
0 Kudos
515

Hi All ,

Has anyone attempted to download a report or an internal table into a true Excel file in background mode ?

There are several ways to download in forground like OLE or GUI functions , but to do it in background mode we would always have to use DATASET commands . But , DATASET commands help to write the contents into a file in a text format separated by a delimiter t.

Example : A Report can be saved in an excel format in the background as a tab delimited or CSV format using DATASET commands .

I tried to achieve the above using OLE automation , but when the job runs on the appserver , the OLE method call fails because Excel Application are generally not installed on the App server .

Any thoughts ...

1 ACCEPTED SOLUTION

juan_suros
Contributor
0 Kudos
120

In several cases, we have saved data into a text file that can be read directly by excel. We used the same technique you mention, creating a text file with ".xls" extension formatted in such a way that Excel can parse it into a spreadsheet automatically.

This technique is not a "true" excel file, of course. Still, your Users will be presented with a file that can be opened and manipulated in Excel without recourse to import wizards or macros.

On several projects, we have used visual basic scripts to accomplish complex manipulations to a downloaded text file through Excel. The VBS code is stored in the SAPscript Standard Text system and downloaded as a text file along with the data file. The VBS file is executed, instantiating Excel, importing the text file into a new spreadsheet, and then using any functionality in the Excel object libraries to format the data for the user.

We have always worked through SAPGUI, but there is no reason you couldn't distribute data and vbs files from your SAP application server to a User's pc and have them kick off the vbs file there.

Message was edited by: Juan Suros

3 REPLIES 3

juan_suros
Contributor
0 Kudos
121

In several cases, we have saved data into a text file that can be read directly by excel. We used the same technique you mention, creating a text file with ".xls" extension formatted in such a way that Excel can parse it into a spreadsheet automatically.

This technique is not a "true" excel file, of course. Still, your Users will be presented with a file that can be opened and manipulated in Excel without recourse to import wizards or macros.

On several projects, we have used visual basic scripts to accomplish complex manipulations to a downloaded text file through Excel. The VBS code is stored in the SAPscript Standard Text system and downloaded as a text file along with the data file. The VBS file is executed, instantiating Excel, importing the text file into a new spreadsheet, and then using any functionality in the Excel object libraries to format the data for the user.

We have always worked through SAPGUI, but there is no reason you couldn't distribute data and vbs files from your SAP application server to a User's pc and have them kick off the vbs file there.

Message was edited by: Juan Suros

0 Kudos
120

Have also a look at Thomas Jungs weblog:

/people/thomas.jung3/blog/2005/02/23/bsp-and-microsoft-excel--learning-to-live-together-part-2

Former Member
0 Kudos
120

This is unusual but can you tell me how you saved a file in the background using the dataset commands? thanks!