2012 Oct 09 3:03 PM
Hello Experts,
I want to run the batch file present on the Application server not on the Presentation server.
I know if it is in presentation server we can use the below methods:
'GUI_EXEC or WS_EXECUTE or by using method CL_GUI_FRONTEND_SERVICES=>EXECUTE '
By using OPEN DATASET we can read/write/change normal file present in application server but how to run the batch file present on the Application Server.
Thanks in advance,
Venkat
2012 Oct 09 3:35 PM
Look at SM49 for external commands executed on AS. You can execute those commands with FMs like SXPG_CALL_SYSTEM or SXPG_COMMAND_EXECUTE.
Regards,
Raymond
2012 Oct 09 3:35 PM
Look at SM49 for external commands executed on AS. You can execute those commands with FMs like SXPG_CALL_SYSTEM or SXPG_COMMAND_EXECUTE.
Regards,
Raymond
2012 Oct 09 3:37 PM
You can use SXPG_COMMAND_EXECUTE to execute command for your operating system for the application server. You can use SM69/SM49 to create command.
2012 Oct 09 5:31 PM
Thanks Raymond and Roy for your quick responses.
I just want to know whether do we have any other option rather than creating external commands.
Like specifying the batch file path so that it(FM or Class) triggers all the commands in the file like we do for batch files present on the presentation server.
Thanks,
Venkat
2012 Oct 09 7:09 PM
This depends mostly on the OS of the AS, some have some "command.com" like command that execute a script.
Regards,
Raymond
2012 Oct 10 5:48 AM
Conclusion:
As suggested by Raymond and Roy i have created External Command using transaction code SM69.
In the Operating system command i have placed my Batch file path which consists of multiple commands.
And i have passed this external command name as import parameter to FM 'SXPG_COMMAND_EXECUTE'.
Thanks all for your support,
Venkat