cancel
Showing results for 
Search instead for 
Did you mean: 

move file in unix server

Former Member
0 Kudos

Hi all,

I have inbound file that has to be moved to another directory path in the unix server once data can be loaded using open data set.

How is the way to move a file from one directory path to another ?

My inbound file in \usr\in\original\data.txt, wanna move the file data.txt to \usr\in\backup\data.txt.

thanks alots.

alia

Accepted Solutions (0)

Answers (2)

Answers (2)

andreas_mann3
Active Contributor
0 Kudos

Hi Alia,

have a look hee:

regards Andreas

Former Member
0 Kudos
DATA: v_filepht LIKE FILENAME-FILEINTERN, "Physical file for p_fnam2

* Open the file in application server
  OPEN DATASET v_filepht FOR OUTPUT IN TEXT MODE.
  IF sy-subrc <> 0.
    MESSAGE s185 WITH v_filepht.           " File opening error
    LEAVE LIST-PROCESSING.

  ENDIF.

   LOOP AT i_logfile INTO w_logfile.
    TRANSFER w_logfile TO v_filepht.
    CLEAR w_logfile.

  ENDLOOP.

   IF sy-subrc = 0.
    WRITE:/ text-055, v_filepht, text-056. " File successfully created
  ELSE.
    WRITE:/ text-057, v_filepht.           " Error creating file
  ENDIF.

 * Closing the file

  CLOSE DATASET v_filepht.

Try this one.