Application Development and Automation 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: 
Read only

Read .XLS file from server

Former Member
0 Likes
538

Colleagues:

A client wants to ftp an excel file directly to the SAP server. Is there a way to read a native excel file from the server? They want to avoid any manual intervention, so uploading from a PC is not an option.

Thanks.

Colleagues:

A client wants to ftp an excel file directly to the SAP server. Is there a way to read a native excel file from the server? They want to avoid any manual intervention, so uploading from a PC is not an option.

Thanks.

2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
0 Likes
494

If the user runs a transaction in dialog, then you may use OLE2 (abap statements CREATE OBJECT, CALL METHOD OF, ...) Search SDN, discussed many times.

If it is read in background, this is a problem. You should connect a Windows server with Excel and make this server process the file.

Read only

gerd_rother
Active Participant
0 Likes
494

Hi Ted,

It depends what you want to do with the file.

One way to read the file from the application server is to use OLE (as Sandra proposed) giving the excel application the URL of the transmitted file. But then of course you will need a presentation server running the program in dialog - i.e. a user. But using this method will give your program complete usage of the excel file.

If you actually want to read the file in background (this is what I understand) the only way to read the file is opening it in binary mode (OPEN DATASET ... BINARY MODE) and to read the file binary. Of course then you have to fight with MS's internal excel format, which I assume will not be much fun.

Can the sending system save the file in Excel as a CSV-file instead of a native Excel file (perhaps assisted by a little VB macro)? In this case you could read that file quite easily. If there is a chance I would go for that option.

Regards, Gerd