Application Development and Automation 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: 
Read only

Change file name

HKany
Participant
0 Likes
704

Hi,

I am coding a LSMW object as an interface.

My Interface has to upload cyclically and automatically two files from a folder. After processing the files have to be renamed and saved in the same folder.

So, does anybody know a SAP function which can do this or maybe how to code it?

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
675

concatenate <original_path> <processed>.txt to file_path.

open dataset file_path...

Hi,

I am coding a LSMW object as an interface.

My Interface has to upload cyclically and automatically two files from a folder. After processing the files have to be renamed and saved in the same folder.

So, does anybody know a SAP function which can do this or maybe how to code it?

Thanks in advance.

4 REPLIES 4
Read only

former_member156446
Active Contributor
0 Likes
676

concatenate <original_path> <processed>.txt to file_path.

open dataset file_path...

Read only

0 Likes
675

More examples please:

Once again. I have to rename the file I upload from the Server and save exactly the same file in the same folder with another name. The original file has to be renamed.

If there is no other way I could try to delete the original file on the server and create a new copy of the original file.

But how to do it?

Read only

HKany
Participant
0 Likes
675

Renaming is not possible.

Read only

0 Likes
675

Is the question still open?

If yes: renaming not possible (you are already aware of it). The only optio is to delete and save again (with different name).

In Presentation server:

use class CL_GUI_FRONTEND_SERVICES

methods:

FILE_DELETE and GUI_DOWNLOAD

In Application server:

commands: DELETE DATASET and OPEN DATASET... to save again with different name