cancel
Showing results for 
Search instead for 
Did you mean: 

OS Command to copy a file

04-24-2007 12:10 PM
3338 views 9 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hi all,

I would like to copy a file to an other directory but I haven't succeeded to do that. I use OS command in process chain. File is located in
directory\xxx (not real) and I can see it when using transaction al11. What is the right operating system, operating system command and parameters for operating system command to make external operating system command (by SM69)? I was thinking simply to use copy-command?

Regards,

Minna

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

eddy_declercq
Active Contributor
0 Likes

Hi Minna,

You need to use external commands for sure (see also http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a6054505211d189550000e829fbbd/frameset.htm). Which external command and what the params are, depend on the OS where your system installed on.

Eddy

-


PS. Reward the useful answers and you will get <a href="http:///people/baris.buyuktanir2/blog/2007/04/04/point-for-points-reward-yourself">one point</a> yourself!

eddy_declercq
Active Contributor
0 Likes

Hi,

An alternative is

the FM ARCHIVFILE_SERVER_TO_SERVER

Eddy

-


PS. Reward the useful answers and you will get <a href="http:///people/baris.buyuktanir2/blog/2007/04/04/point-for-points-reward-yourself">one point</a> yourself!

Answers (3)

Answers (3)

Former Member
0 Likes

Minna

Use the <b>'Touch'</b> command which can update the access and modification times of a file. This is a UNIX OS command.

The <b>touch</b> command updates the access and modification times of each file specified by the File parameter of each directory specified by the Directory parameter. If you do not specify a value for the Time variable, the touch command uses the current time.

I have used this command to save files onto the application server directory.

Hope this helps.

Former Member
0 Likes

Hi,

Can you tell me more specific what else I need if I use Touch command, it's new command to me.

Thanks,

Minna

eddy_declercq
Active Contributor
0 Likes

Hi,

The touch command creates an empty file if it not already exist.

See also http://www.unet.univie.ac.at/aix/cmds/aixcmds5/touch.htm

Eddy

-


PS. Reward the useful answers and you will get <a href="http:///people/baris.buyuktanir2/blog/2007/04/04/point-for-points-reward-yourself">one point</a> yourself!

Former Member
0 Likes

Hi,

Try and see whether it is working,

You can use Operating system - SunOs, Windows Env.

command - Copy

Parameters - o=rwx ./invoice.csv (your file path)

when you are executing you can give additional parameters

and you can specify target host and destination.

rgrds,

v.sen

Message was edited by:

Senthilkumar Viswanathan

Message was edited by:

Senthilkumar Viswanathan

Former Member
0 Likes

Hi,

Can you explain more this Parameters - o=rwx ./invoice.csv

Thanks,

Minna

eddy_declercq
Active Contributor
0 Likes

Hi,

These are the file permission

O stands for others, thus not the owner and co members of the owner's group

R read

W write

X execute

See also http://www-acs.ucsd.edu/info/permissions.php

Eddy

-


PS. Reward the useful answers and you will get <a href="http:///people/baris.buyuktanir2/blog/2007/04/04/point-for-points-reward-yourself">one point</a> yourself!

Former Member
0 Likes

Hi,

yes, SM69 (create) and SM49 (execute) would work.

otherwise create a little ABAP for that (found in another thread...)



report zfilecopy.
 
Parameters: d1 type localfile default '/usr/sap/filename.ext',
            d2 type localfile default '/usr/sap/filename.ext'.
 
data: itab type string.
data: wa type string.
 
 
start-of-selection.
 
* Read file
  open dataset d1 for input in text mode.
  if sy-subrc = 0.
    do.
      read dataset d1 into wa.
      if sy-subrc <> 0.
        exit.
      endif.
      append wa to itab.
    enddo.
  endif.
  close dataset d1.
 
 
* Copy to new file
  open dataset d2 for output in text mode.
  loop at itab into wa.
    transfer wa to d2.
  endloop.
  close dataset d2.
 
* Delete the first
  delete dataset d1.

hope this helps,

Olivier.