10-09-2007 3:39 AM
Hi,
I want to move a network file into another location. How do I do this in abap?
Thanks.
Tyken
10-09-2007 4:07 AM
Hi,
maybe you can use open dataset, here is an example:
data: file_add1 type string,
file_add2 type string,
itab type table of string,
wtab like line of itab.
file_add1 = '//network_address/file.any'.
file_add2 = '//network_address2/file.any'.
open dataset file_add1 for input encoding default.
do.
transfer file_add1 to wtab.
if sy-subrc = 0.
append wtab to itab.
else.
exit.
endif.
clear wtab.
enddo.
close dataset file_add1.
open dataset file_add2 for output encoding default.
clear wtab.
loop at itab into wtab.
transfer wtab to file_add2.
clear wtab.
endloop.
close dataset file_add2.
Then delete file_add1.
Hope it helps,
Regards,
John.
10-09-2007 4:10 AM
hi john,
the file has a timestamp and I want it to be retained. I want a move command like 'mv' in unix. I want the file transferred from destination to source, meaningthe file will get deleted in the destination automatically.
thanks.
tyken
10-09-2007 4:16 AM
hmmmm,
try to read this, maybe it will be usefull:
http://help.sap.com/saphelp_47x200/helpdata/en/c4/3a8023505211d189550000e829fbbd/frameset.htm
Regards,
John.
10-09-2007 4:08 AM