Application Development and Automation 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: 
Read only

moving file

Former Member
0 Likes
913

hi all,

how can i move file from one directory to another directory in apllication server (al11).

thank you.

6 REPLIES 6
Read only

Former Member
0 Likes
813

Hi,

You can downlaod the data using OPEN DATASET,READ & CLOSE DATASET into internal table from the specified location of the apllication server and upload the data into the new folder of the Aplication server using OPEN DATASET,TRANSFER & CLOSE.

Now Using DELETE DATASET delete the old file from Application server.

OR

Ckeck this FM DX_FILE_COPY & EPS_FILE_DELETE

Edited by: Avinash Kodarapu on Jan 11, 2009 12:33 PM

Read only

Former Member
0 Likes
813

check this report program

RSFTP002

Read only

Former Member
0 Likes
813

hi,

I just hit a search with term

"move file in application server" and the very first result of the search had given various solutions, i would not paste the link though.

Use the search by urself to get the answer if the above program given by me has problems.

Happy searching on SDN

Read only

Former Member
0 Likes
813

Hi,

You try this code for your requirement.

PARAMETERS:

s_file TYPE localfile DEFAULT '/tmp/xtest1.txt',

d_file TYPE localfile DEFAULT '/tmp/xtest2.txt'.

CONSTANTS:

c_buflen TYPE i VALUE 100.

DATA:

buf(100) TYPE x,

actlen TYPE i.

START-OF-SELECTION.

OPEN DATASET s_file FOR INPUT IN BINARY MODE.

IF sy-subrc = 0.

OPEN DATASET d_file FOR OUTPUT IN BINARY MODE.

IF sy-subrc = 0.

DO.

READ DATASET s_file INTO buf MAXIMUM LENGTH c_buflen ACTUAL LENGTH actlen.

IF actlen > 0.

TRANSFER buf TO d_file LENGTH actlen.

ELSE.

EXIT.

ENDIF.

ENDDO.

CLOSE DATASET d_file.

CLOSE DATASET s_file.

DELETE DATASET s_file.

ENDIF.

ENDIF.

Regards,

Joan

Read only

0 Likes
813

thanks u resollved my prob.

Read only

Former Member
0 Likes
813

ghfgh