2009 Apr 07 9:59 AM
Hi Expert,
I remeber that there is a function module which can be used to execute OS command, but forget the FM name.
Does any expert know the FM name?
Thanks in advance,
Best Regards, Johnney.
2009 Apr 07 10:41 AM
Create the command name in SM49 defining the operating system name and other parameters. Then use the command in FM SXPG_COMMAND_EXECUTE to execute OS commands in ABAP.
Hi Expert,
I remeber that there is a function module which can be used to execute OS command, but forget the FM name.
Does any expert know the FM name?
Thanks in advance,
Best Regards, Johnney.
2009 Apr 07 10:04 AM
in transaction SM69 create external command,
call command using function, example:
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
commandname = w_command
ADDITIONAL_PARAMETERS = w_output
IMPORTING
STATUS = w_status
TABLES
EXEC_PROTOCOL = LOG.
2009 Apr 07 10:05 AM
Hi,
"SXPG_COMMAND_EXECUTE" is the FM which will Execute an External Command.
regards,
Naveen
2009 Apr 07 10:07 AM
2009 Apr 07 10:11 AM
Hi ,
The FM name is 'SXPG_COMMAND_EXECUTE'.
You need to create the command in SM69.
You can test the same command in SM49.
Regards,
Anuj
2009 Apr 07 10:14 AM
You use this FM 'SXPG_COMMAND_EXECUTE' to execute OS command.
Regards,
Joan
2009 Apr 07 10:41 AM
Create the command name in SM49 defining the operating system name and other parameters. Then use the command in FM SXPG_COMMAND_EXECUTE to execute OS commands in ABAP.
2009 Apr 07 11:40 AM
Hi Experts,
Thanks for your reply.
One more question about SXPG_COMMAND_EXECUTE. I need to pass parameters via input ADDITIONAL_PARAMETERS. My parameter is more than 380 characters, while the length of ADDITIONAL_PARAMETERS is only 255.
How to handle the case? Does any expert have idea?
Thanks a lot.
Best Regards, Johnney.
2009 Apr 08 2:38 AM
Does any expert have idea over the case?
Thanks in advance,
Best Regards, Johnney.
2009 Apr 08 2:42 AM
2009 Apr 08 6:04 AM
I use SXPG_STEP_XPG_START, this FM works fine.
I close the message.
Thanks for all your help. Best Regards, Johnney.
2011 Apr 25 3:18 PM
Hello , I have the same problem I created a command in SM49 transaction with command name = ZCOPY, and S.O command = "scp". because I want to copy the files in unix (al11) to windows server.
my problem is that I want to copy a lot of file in the same parameter but I only have 255 caracter. If I create a new fuction 'Z' then I have to change a lot of other function that are calling by the 'SXPG_COMMAND_EXECUTE'.
In the parameters I have to repeat all the time the origin directory:'/usr/sap/DEV/RetencionesWeb/ if i don´t repeated it the file is not found
The command is like this:
SCP
file 1 = '/usr/sap/DEV/RetencionesWeb/26000000012009.PDF'
file 2 = '/usr/sap/DEV/RetencionesWeb/26000000012009.PDF'
Destination windows server
Do you know any way to don´t repeat the '/usr/sap/DEV/RetencionesWeb/?
Thanks,
Lucila
Edited by: Lucila Isernia on Apr 25, 2011 4:31 PM
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |