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: 

CLOSE DATASET CHANGE FILE NAME

Gaku
Explorer
0 Kudos
454

Hello,experts.

I want to change server file name by ABAP when close dataset is executed.

Please tell me how to change server file name by ABAP.

Thanks.

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
384

2 possibilities:

- rename by OS command (search SXPG* function modules in the forum)

- in ABAP, read old file + create new file + delete old file (so, worst solution)

4 REPLIES 4

abo
Active Contributor
384

Without executing external programs, your only option is to write a temporary file during processing, then read it back and write it under the new name. Take care to pick a name which will be ignored by whatever process is waiting to consume your file and you should be fine.

FredericGirod
Active Contributor
0 Kudos
384

Or create your own global class to manage server filename. Inside you class, you will be able to define what to do when you close your file.

abo
Active Contributor
0 Kudos
384

That's a matter of programming style, OO or plain old. Point is, there is no "RENAME DATASET" in ABAP.

Sandra_Rossi
Active Contributor
385

2 possibilities:

- rename by OS command (search SXPG* function modules in the forum)

- in ABAP, read old file + create new file + delete old file (so, worst solution)