If you only supply the COMMAND parameter then it will only call the executable program, but if you want to call a specific file e.g. BOOK1.XLS then you should supply the PARAMETER with the file name.
Here’s the ABAP sample code to call an EXCEL workbook.
REPORT Z_Calling_EXE_Program.
CALL FUNCTION 'GUI_RUN'
EXPORTING
COMMAND = 'EXCEL.EXE'
PARAMETER = 'C:UsersUserDocumentsBOOK1.XLS'.
* CD = '
* IMPORTING
* RETURNCODE = .
When you run the program, make sure that you already created the Excel workbook in the destinated folder. You can also change the COMMAND parameter into another type of executable program, e.g. NOTEPAD.EXE, WORD.EXE, etc.
You can also call a web browser, e.g. FIREFOX and immediately open certain website. e.g. www.google.com.
CALL FUNCTION 'GUI_RUN'
EXPORTING
COMMAND = 'FIREFOX.EXE'
PARAMETER = 'GOOGLE.COM'.
* CD = '
* IMPORTING
* RETURNCODE = .
Post a Comment