SAP ABAP Function Module to Run an Executable Program with Parameters
If you wish to run an executable program from SAP it can be done by using the following Function Module.
GUI_RUN
These function modules are useful when you want to create an interface with SAP. Many a times it may be required to call an executable program from SAP and pass some Parameters to it. The called user program can then process the data and return back parameters to SAP. Function modules similar to GUI_RUN can be used to build such interfaces.
We will see a simple example of opening a Notepad file from SAP and another example by opening a website through a browser.
Example 1
REPORT ZEX_GUIRUN .
CALL FUNCTION 'GUI_RUN' EXPORTING COMMAND = 'NOTEPAD.EXE' PARAMETER = 'c:\TEST.TXT' * CD = ' * IMPORTING * RETURNCODE = .
Example 2
REPORT ZEX_GUIRUN .
CALL FUNCTION 'GUI_RUN' EXPORTING COMMAND = 'FIREFOX.EXE' PARAMETER = 'GOOGLE.COM' * CD = ' * IMPORTING * RETURNCODE = .
So if you want to open a browser you can use the function module GUI_RUN.
Some other function modules that open a browser from within SAP are as follows.
Always use Pretty Printer and Extended Program Check before releasing the code.
Do not leave unused code in the program. Comment the code thoroughly. Align the comments and the Code. Follow the SAP Standards and SAP Best Practices guidelines. It’s a good practice to take a dump of the code on your local drive.
No comments:
Post a Comment