on 03-22-2005 3:25 PM
I'm trying to execute Excel from a ITS transaction using the GUI_EXEC, GUI_RUN or WS_EXECUTE functions I get a 'Select Program' dialog box from windows. I then have to find and select 'excel.exe' for it to work. Is there anyway to avoid the windows dialog box? It works find from SAPGUI.
Here's my code:
data: PATHNAME LIKE SOXPC-PATH.
Check where the Excel is
CALL FUNCTION 'SO_PROGNAME_GET_WITH_PATH'
EXPORTING
DOCTYPE = 'XLS'
IMPORTING
PATHNAME = PATHNAME
EXCEPTIONS
OTHERS = 1.
Call Excel
CALL FUNCTION 'WS_EXECUTE'
EXPORTING
PROGRAM = PATHNAME
COMMANDLINE = 'S:\0004.xls'
INFORM = 'X'
EXCEPTIONS
OTHERS = 1.
Thanks,
Jaed
Hi Jaed,
I would recommend to use the class CL_GUI_FRONTEND_SERVICES. This class provides a method EXECUTE which can be used to open any document. Just feed the parameter DOCUMENT with the name of the Excel file.
Best regards,
Klaus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Klaus,
I have a similar problem in that I use ws_execute or Execute method of cl_gui_frontend_services and other methods and all of them seem to present the box asling for a file name rather that simply openning the file - as happens with the same TCODE in the gui.
Could someone please post soem code that works from the ITS.
Thanks Peter Carroll
Hi Peter,
because webgui is a browser application and therefore cross-platform, webgui don't know which document type should be displayed with which application. When you execute a document like i.e. excel, webgui asks you once for the viewer application that should be used to display the document. After selecting the viewer webgui stores this information in the file execookie.txt. Next time is uses this information to display the document. On windows this file is normally stored under \Document and Setting\<USERNAME>
You may also create this file manually as described in note 554492.
Best regards,
Klaus
If you wanted to role the execookie.txt file out to your user community, assuming they all use Internet Explorer, you could role a file which lets IE determine which application to launch. The following file worked for me:
TXT
c:\Program Files\Internet Explorer\iexplore.exe
JPG
c:\Program Files\Internet Explorer\iexplore.exe
JPEG
c:\Program Files\Internet Explorer\iexplore.exe
GIF
c:\Program Files\Internet Explorer\iexplore.exe
DOC
c:\Program Files\Internet Explorer\iexplore.exe
BMP
c:\Program Files\Internet Explorer\iexplore.exe
c:\Program Files\Internet Explorer\iexplore.exe
TIF
c:\Program Files\Internet Explorer\iexplore.exe
PPT
c:\Program Files\Internet Explorer\iexplore.exe
PPS
c:\Program Files\Internet Explorer\iexplore.exe
XLS
c:\Program Files\Internet Explorer\iexplore.exe
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.