10-07-2008 11:12 AM
Hallo guys,
I have to rename a file on SAP server. How to do it?
Is there some FM for that?
Thanks.
10-07-2008 11:24 AM
10-07-2008 11:38 AM
Maybe I could create a new file with changed name, copy content of old file into new one and than delete the old one.
What are the commands for doing that?
Thanks.
10-07-2008 12:14 PM
if u wanto rename the se38 Program
than goto se38 and give ur old program name and select program which is in menu bar and click on that u find rename (CTRL+f6)than rename ur program
10-19-2008 8:57 PM
Hi Marek,
till now I know 3 possibilities
- to create a new unix command "mv..." in SM69 and then call this command - for that I am pretty sure you don't have authorization
- to use FM SXPG_CALL_SYSTEM with "mv command"
- or your suggested solution to copy it into new file and to delete the old one:
DATA: f1 type localfile value '/temp/file1.txt',
f2 type localfile value '/temp/file2.txt'.
data: lt_tab(50) type table of c.
data: wa_tab(50) type c.
start-of-selection.
open dataset f1 for input in text mode.
if sy-subrc = 0.
do.
read dataset f1 into wa_tab.
if sy-subrc 0.
exit.
endif.
append wa_tab to lt_tab.
enddo.
endif.
close dataset f1.
open dataset f2 for output in text mode.
loop at lt_tab into wa_tab.
transfer wa_tab to f2.
endloop.
close dataset f2.
delete dataset f1.
Regards,
Karol