Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent!!! FTP a file same server

Former Member
0 Kudos

Hi, experts

Please, I need to copy a file via FTP same server but different directory, how can I do this???

I will appreciate it any helfull information, thanks in advance.

Regards

mgg

7 REPLIES 7

Former Member
0 Kudos

Hi,

Maybe you can use this function "MSS_CALL_SYSTEM" that make a msdos command. So you would only need to move ('Move DIR1\File DIR2\File') or copy the file to the correct directory.

Best regards

Jaime

Former Member
0 Kudos

HI,

if the server is same you can just us open data set.. here is the code .. if ur sap is on unix then use the following code to mv the file from one diretory to other.

DATA:

*-- Record Counter

L_COUNT(10) TYPE N,

MSG(100) TYPE C.

DATA : V_LENGTH TYPE I.

DATA: DG_UNIX_LOC(100) TYPE C.

DATA: BEGIN OF DT_TABL OCCURS 0,

LINE(200),

END OF DT_TABL.

DATA: BEGIN OF DT_TABL_HIST OCCURS 0,

LINE(200),

END OF DT_TABL_HIST.

CLEAR: DG_UNIX_LOC.

DG_UNIX_LOC(9) = 'mv /usr/sap/pd1/file.csv /usr/sap/pd2/file.csv '.

DG_UNIX_LOC+9(45) = P_AFILE.

DATA : V_STRING(100) TYPE C.

REFRESH DT_TABL.

CALL 'SYSTEM' ID 'COMMAND' FIELD DG_UNIX_LOC

ID 'TAB' FIELD DT_TABL-SYS.

U can use all the unix commands..

MV to move

cp to copy

ls to list the files etc.

<a href="http://www.indiana.edu/~uitspubs/b017/">Unix Commands</a>

Message was edited by:

Mahesh Raganmoni

0 Kudos

U can use all the unix commands..

MV to move

cp to copy

ls to list the files etc.

<a href="http://www.indiana.edu/~uitspubs/b017/">Unix Commands</a>

Former Member
0 Kudos

Hi,

The code writed below is the same like the function code. It is created for a UNIX computer and with the code move (mv). If you need greater directories you can modify the field table instead to 100 to the number you need (ex 200)

Kind Regards

Jaime

0 Kudos

Thanks guy all your answer gime an idea how to solve it, but I miss to write that the server is AS400, may I use same logic of UNIX code lines

Regards

mgg

0 Kudos

HI,

read the conetent of the file into an internal table

delete the file by using DELETE DATASET command

create a file in the required directory and copy the content of the internal table.

just use normal open dataset traster and close dataset commands..these will work irrecpective of the OS.

Thaks

Mahesh

0 Kudos

Thanks Mahesh ... I was wondering may I do this on AS400 server? I understand that READ/DELETE dataset commands are for files on SAP Server.

Regards

mgg