2007 Apr 18 2:35 AM
Hi guys,
i have created command zcmd in SM69 to run a .BAT file for encryption.
How to set the "operating system command" and "Parameters for operating system command" ?
Any example will be appreciated greatly.
2007 Apr 18 4:46 PM
Hi,
i usualy use FM 'SXPG_COMMAND_EXECUTE' to execute sm69 comands.
Here is and example for 'rm' comand (delete):
I had created a external comand in sm69 , named Z_DELETE with operating system HP-UX, type customer and Operating System command 'rm'.
Then in my report, i executed FM this way:
data: PARAM LIKE SXPGCOLIST-PARAMETERS.
param = '//dir1/dir2/file.txt'.
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
COMMANDNAME = 'Z_DELETE'
OPERATINGSYSTEM = SY-OPSYS
TARGETSYSTEM = SY-HOST
STDOUT = 'X'
STDERR = 'X'
TERMINATIONWAIT = 'X'
TRACE = ' '
ADDITIONAL_PARAMETERS = PARAM
IMPORTING
STATUS = STATUS
TABLES
EXEC_PROTOCOL = RESULTADO
EXCEPTIONS
NO_PERMISSION = 1
COMMAND_NOT_FOUND = 2
PARAMETERS_TOO_LONG = 3
SECURITY_RISK = 4
WRONG_CHECK_CALL_INTERFACE = 5
PROGRAM_START_ERROR = 6
PROGRAM_TERMINATION_ERROR = 7
X_ERROR = 8
PARAMETER_EXPECTED = 9
TOO_MANY_PARAMETERS = 10
ILLEGAL_COMMAND = 11
WRONG_ASYNCHRONOUS_PARAMETERS = 12
CANT_ENQ_TBTCO_ENTRY = 13
JOBCOUNT_GENERATION_ERROR = 14
OTHERS = 15.
Hope this help's,
Regards,
Hi guys,
i have created command zcmd in SM69 to run a .BAT file for encryption.
How to set the "operating system command" and "Parameters for operating system command" ?
Any example will be appreciated greatly.
2007 Apr 18 4:46 PM
Hi,
i usualy use FM 'SXPG_COMMAND_EXECUTE' to execute sm69 comands.
Here is and example for 'rm' comand (delete):
I had created a external comand in sm69 , named Z_DELETE with operating system HP-UX, type customer and Operating System command 'rm'.
Then in my report, i executed FM this way:
data: PARAM LIKE SXPGCOLIST-PARAMETERS.
param = '//dir1/dir2/file.txt'.
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
COMMANDNAME = 'Z_DELETE'
OPERATINGSYSTEM = SY-OPSYS
TARGETSYSTEM = SY-HOST
STDOUT = 'X'
STDERR = 'X'
TERMINATIONWAIT = 'X'
TRACE = ' '
ADDITIONAL_PARAMETERS = PARAM
IMPORTING
STATUS = STATUS
TABLES
EXEC_PROTOCOL = RESULTADO
EXCEPTIONS
NO_PERMISSION = 1
COMMAND_NOT_FOUND = 2
PARAMETERS_TOO_LONG = 3
SECURITY_RISK = 4
WRONG_CHECK_CALL_INTERFACE = 5
PROGRAM_START_ERROR = 6
PROGRAM_TERMINATION_ERROR = 7
X_ERROR = 8
PARAMETER_EXPECTED = 9
TOO_MANY_PARAMETERS = 10
ILLEGAL_COMMAND = 11
WRONG_ASYNCHRONOUS_PARAMETERS = 12
CANT_ENQ_TBTCO_ENTRY = 13
JOBCOUNT_GENERATION_ERROR = 14
OTHERS = 15.
Hope this help's,
Regards,
2007 Apr 18 4:57 PM
Check this link;
http://help.sap.com/saphelp_erp2005/helpdata/en/c4/3a8023505211d189550000e829fbbd/frameset.htm
Regards,
Ravi
2007 Apr 19 2:46 AM
Hi Rosa,
Good days!
Thanks for your reply.
Btw, my OS is Window NT... so I can't test the example that u give me.
Do u have any others examples or documentation related to SM69?
Regards,
Hikaruno
2007 Apr 19 12:04 PM
Hi,
sorry but all the external commands i have done are for HP-UX systems. So all the examples are related to that !
http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a7f2c505211d189550000e829fbbd/content.htm
regards,
2010 Jun 26 10:13 AM
Hi,
Can we execute shell script .sh through external command. If yes than pls share some examples it would be great help.
Thanks a lot in advace,
Regards,
2013 Jun 18 4:35 PM
Hi Ritesh,
Yes you can execute shell script through external command defined in SM69.
First create test1.sh file under /home directory and then create a external command in SM69 with following details:
Command name : ZT (your choice)
Op System : Linux
External program : sh
parameters of external program : /home/test1.sh
Alpa
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |