‎2010 Jan 18 6:02 AM
Hi All,
I need to use unix command (MOVE) in ABAP code for transfering a file from one directory to another directory.
Can any one help with how to used unix commands in ABAP?
Thanks in advance.
Regards,
Hemendra
‎2010 Jan 18 6:44 AM
The recommended approach always used to be to use transaction SM69 to define a "soft" command name to the operating system command so that it could be configured to work across Windows, Unix etc. For example:
Command name OS Type OS command Parameters for operating system command
Z_FILE_MOVE SunOS Customer mv ? ?
You can then call function module SXPG_COMMAND_EXECUTE (quite well documented) to actually perform the command passing in the appropriate number of parameters.
Jonathan
‎2010 Jan 18 12:46 PM
Check this link for your query.
[http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/8c5ceb90-0201-0010-66b1-aae00269b533]
cheers
Aveek
‎2010 Jan 18 12:50 PM
HI you can make use of fm ARCHIVFILE_SERVER_TO_SERVER for moving files.
For executing a unix command configure it in SM69 and execute it from program using fm
SXPG_COMMAND_EXECUTE
‎2010 Jan 20 8:48 AM
‎2010 Jan 20 9:08 AM
Please post your solution, so that i will be helpful for others who search the forum.
‎2010 Jan 20 9:15 AM
Hi Kesav,
Solution is same as you said:
Create unix command parameter in SM69 and use in FM SXPG_COMMAND_EXECUTE.