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: 

Moving one file in unix directory path into another unix directory path

Former Member
0 Kudos

Hi All,

I have issue regarding moving one file in one unix directory into another unix directory.

Actual requirement is as below:

I have two unix directories 1. /var/opt/working 2. /var/opt/error

Now i have a file [ FILE1 ] in [/var/opt/working] working directory.

In code checking i found it is error file now in my abap i want to move/send this file [FILE1] to another unix directory [/var/opt/error].

How can solve this issue in ABAP code.

Can anybody solve this issue!

Thanks,

Deep.

1 ACCEPTED SOLUTION

former_member223537
Active Contributor
0 Kudos

1. Open the 1st file using Open dataset for input /var/opt/working

2. Get the data into internal table

3. Open the 2nd file using Open dataset for output /var/opt/error

4. TRANSFER the data from the internal table to 2nd file

5. CLOSE 2nd file

6. Close 1st file

7. Delete 1st file using DELETE DATASET dsn.

2 REPLIES 2

former_member223537
Active Contributor
0 Kudos

1. Open the 1st file using Open dataset for input /var/opt/working

2. Get the data into internal table

3. Open the 2nd file using Open dataset for output /var/opt/error

4. TRANSFER the data from the internal table to 2nd file

5. CLOSE 2nd file

6. Close 1st file

7. Delete 1st file using DELETE DATASET dsn.

Karan_Chopra_
Active Participant
0 Kudos

Open dataset for output is returning sy-subrc = 8.

why it is not creating the the file is not presend on that path