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: 

ABAP OLE (excel) and access to file on server

Former Member
0 Kudos

Hi all,

I have successfully used OLE technology for accessing an excel file stored in my local pc. I was thinking about this issue: if the file is stored in the unix file server (visible via AL11), how can I access this? For the opening of the excel file I use following syntax:

call method of e_work 'OPEN'

exporting

#1 = p_file.

Any suggestion is well accepted!

14 REPLIES 14

Former Member
0 Kudos

Hi Gianluca,

Kindly find the link below.

http://help.sap.com/saphelp_47x200/helpdata/en/59/ae3cac488f11d189490000e829fbbd/frameset.htm

<REMOVED BY MODERATOR>

Thanks,

Satyesh

Edited by: Alvaro Tejada Galindo on Jun 25, 2008 3:40 PM

0 Kudos

Hi,

I check the link you provided me but I don't find an help. In particular, I searched in the forum but every use of this functionality is referred to local files (stored in C:\).

Regards,

Former Member
0 Kudos

no idea about it?

regards,

Gianluca

0 Kudos

hi,

I believe the command:

call method of e_work 'OPEN'

exporting

#1 = p_file.

expects a URL which Windows understands. So the SAP server is not an option here.

First I would copy the file from the Application server to the Presentation server (to a temp folder on the local machine for example). This can be done in the program as well.

hope this helps some

ec

0 Kudos

Hi Eric,

I think your idea is very good. One last question about it: the program that opens the excel file is scheduled in the application server, I think. So the excel file to be processed should be copied into the application server instead of the presentation server. Am I wrong?

Thanks a lot for the useful reply!

Gianluca

0 Kudos

The method you mentioned above calls the Excel method directly, so it has to run on a Presentation Server where Excel is implemented and it has to run in foreground! Otherwise there is no chance...

0 Kudos

Hmm.. I have to do some checks. If the process has to run in foreground, I think I cannot schedule a program that use these excel functions. The scenario I conjectured was:

- An excel file is loaded in the application server (and transferred in the presentation server)

- The job that makes the access to this file is scheduled in background and processes the excel file.

If what you tell is true, I cannot use this function for accessing the excel file.

Thanks again for the reply!

0 Kudos

I'm looking for other BW ABAP functions for opening an excel file. If I cannot use OLE automation for opening in background process an excel file stored in the application server, does anyone know if there are other ABAP functions that let me possible to open an excel file and to select a specified range of cells (identified by Sheet-Row-Column)?

Regards,

Gianluca

0 Kudos

try FM ALSM_EXCEL_TO_INTERNAL_TABLE

0 Kudos

Hi Eric,

unfortunately, ALSM_EXCEL_TO_INTERNAL_TABLE function module doesn't exist in my environment...

Regards,

Gianluca

0 Kudos

this FM is in function group SAPLALSMEX and this is the only FM in this group. I would suggest to copy this FM and the group into a Z... one (in your R/3 system) and transport the whole thing to BW.

0 Kudos

Hi,

I tried to copy the FM code to BW environment, but there are some datatypes that do not exists in BW (like ty_t_sender or OLE2_object). I don't think copy the FM is a feasible solution. And now I use OLE functions in BW, so if this FM also uses OLE technology I don't know if it solves my problem.

Thanks for the availability!

Gianluca

0 Kudos

I just realised, if these OLE2 things don't exist at all in BW, than you have no chance to communicate with Excel. So you need to create them anyway.

0 Kudos

Hi,

I check the ALSM_EXCEL_TO_INTERNAL_TABLE function. The description of the FILENAM parameter is: "Local file for upload/download".

I really don't know if using this function is possible to open a file stored into the application server.

If it is so, doesn't anybody know a method for opening an excel file stored into the application server? Something that has a set of methods useful for extracting data after specifying SHEETROWCOL ?

Regards,

Gianluca