2023 Mar 12 9:06 AM
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.
2023 Mar 14 9:40 AM
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)
2023 Mar 12 11:49 AM
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.
2023 Mar 13 6:37 AM
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.
2023 Mar 13 9:12 AM
That's a matter of programming style, OO or plain old. Point is, there is no "RENAME DATASET" in ABAP.
2023 Mar 14 9:40 AM
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)