Skip to Content
author's profile photo
Former Member

How to move a file from one folder to another using data sets

Hi ABAP Gurus,

we have a scenario where in which after a file is read from a folder Eg: /home/prd/in on <b>application server</b>, it has to be <b>deleted from current folder</b> and has to be <b>moved to processed folder</b> Eg : /home/prd/processed.

We are using datasets for read / write . Can anybody help in this regard?

Thanx in advance ,

Regards,

Sriram.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Posted on Feb 24, 2005 at 07:57 AM

    Hi,

    try this:

    DATA: COMMAND(200).

    DATA: BEGIN OF TABL OCCURS 0,

    LINE(255),

    END OF TABL.

    command = 'mv /home/prd/file.in /home/prd/processed/file.out'.

    CALL 'SYSTEM' ID 'COMMAND' FIELD COMMAND ID 'TAB' FIELD TABM-SYS.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Feb 24, 2005 at 06:09 AM

    Hi,

    Could you please elaborate what problem are you facing in carrying out the task you mentioned? If you could post the portion of code where the error occurs, that would help as well.

    Regards

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Feb 09, 2006 at 02:42 PM

    Hi Sriram,

    Another option would be as follows

    open a new dataset(the processed file) for writing

    write the contents that has be read using the "Transfer"abap statement

    Delete the original file using the "delete dataset" abap statement to delete the original file...

    Thanks,

    Renjith.

    Add comment
    10|10000 characters needed characters exceeded