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: 

How to read excel binary file in ABAP application server

Former Member
0 Kudos

Hi Gurus,

I have to read business partner data from the binary format of an excel file in application server. I searched in forums but only found solutions about using ole2 objects, but in ABAP application server there is no excel APIs, so I have to read binary directly. You know it is rather difficult, do you have any clues or sample function modules? Thanks!

Best regards,

Hao

6 REPLIES 6

Clemenss
Active Contributor
0 Kudos

Hi Deng,

I never heard of a method to achieve it. It will be easier to load the file into excel and save it as tab-delimited or CSV text file.

You can use the function modules from SE37 to get your files from and to server:

ARCHIVFILE_CLIENT_TO_SERVER

ARCHIVFILE_SERVER_TO_CLIENT

Don't forget to mark the lowercase checkbox in SE37.

Regards,.

Clemens

Former Member
0 Kudos

Hi Clemens,

Thanks for your quick reply!

But my requirement is to run a job in an application server periodically without the help of any client. So I'm afraid your solution wouldn't work. I guess I have to go a tedious way to deal with xls files.

Regards,

Hao

Clemenss
Active Contributor
0 Kudos

Hi Deng,

I think there are two possible solutions:

1. Get the file created as tab-delimited or CSV as recommended earlier

2. Excel files are BIFF (Binary Interchange File Format). The Microsoft office 97 developer kit has tools for analysis and access. You may search for existing interface software or create your own ABAP code. Publish it on SDN and win great merits.

Regards,

Clemens

Former Member
0 Kudos

Hi Clemens,

You know it is a big challenge for me and even for some experts. Hope I can do it.

Thanks!

Best regards,

Hao

Former Member
0 Kudos

Solution:

1. Use function module ARCHIVFILE_SERVER_TO_CLIENT to transfer an excel file from an application server to a client workstation (use some temporary directory as a target path, for example from environment variable TEMP).

2. Use function module ALSM_EXCEL_TO_INTERNAL_TABLE, specify a path to the file on the client workstation.

3. Delete the file on the client workstation using CL_GUI_FRONTEND_SERVICES class (FILE_DELETE method).

Done.

former_member334777
Active Participant
0 Kudos

This message was moderated.