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: 

Rename the file in application server

Former Member
0 Kudos

Hi Experts,

I want to rename the file which is in Application Server.

E.g:- Current File in Application Server is '\user\sd\file1'

I want to change the above file name to '\user\sd\file1_old' in Application Server.

Please help me if any one aware of this.

Thanks & Regards,

Chandu

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos

Hi ,

You can use class cl_cts_language_file_io and its static method copy_files_local. you can refer this blog [Copying/Renaming a file in Application Server|http://help-abap.zevolving.com/2011/10/copyingrenaming-a-file-in-application-server-2/]. It does not directly renames the file. It creates a copy first with the new file name. Later you have to delete your previous file using delete dataset.

4 REPLIES 4

Former Member
0 Kudos

Hi,

Please check these links

<Link farm removed>

Regards,

Ben

Edited by: Suhas Saha on Feb 10, 2012 2:32 PM

Phillip_Morgan
Contributor
0 Kudos

Hello,

What you want to do is execute a command on the host operating system.

This can be done with function module SXPG_COMMAND_EXECUTE.

This module will execute commands that have been predefined in SAP. To see what is available look in SM49.

If you have the autorizations you can create your own or ask for it to be created.

More general information can be found [here|http://wiki.sdn.sap.com/wiki/display/ABAP/CreationofExternalCommandswiththehelpofUNIXCodingin+SAP].

Hope this is helpful.

kesavadas_thekkillath
Active Contributor
0 Kudos

Hi ,

You can use class cl_cts_language_file_io and its static method copy_files_local. you can refer this blog [Copying/Renaming a file in Application Server|http://help-abap.zevolving.com/2011/10/copyingrenaming-a-file-in-application-server-2/]. It does not directly renames the file. It creates a copy first with the new file name. Later you have to delete your previous file using delete dataset.

Former Member
0 Kudos

Hi,

Check the bellow link for your requirement.

<link farm removed>

Regards,

Goutam Kolluru.

Moderator Message: Please do not spoon feed.

Edited by: Suhas Saha on Feb 10, 2012 3:01 PM