2005 Mar 09 4:01 PM
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 ...
2005 Mar 09 6:11 PM
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
2005 Mar 09 6:11 PM
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
2005 Mar 10 7:49 AM
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
2005 Mar 16 10:50 PM
This is unusual but can you tell me how you saved a file in the background using the dataset commands? thanks!