on ‎2006 Feb 28 2:56 PM
Hi..I am pretty new to the world of ABAP.
I have the following task.
I need to right a function module that will be responsible for renaming files on the R/3 system (to a certain predefined format). Basically, I am thinking that FM will import/accept an old file name (incl path) as a parameter, and then FM will take care of actually renaming the file and returning the name of the new filename.
Since I am very new to all the ABAP, can any of you give me some pointers, or maybe some sample code if anybody done something similar?
All the help is appreciated.
thank you
Request clarification before answering.
Hi
U need to use system command.
regard
vinod
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andrei,
Just for completion sake, you can also use the 2 following transactions that transfer files:
- CG3Y : Server to PC
- CG3Z : PC to Server
Best regards,
Guillaume
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andrei,
You may try SAP program <b>RSFTP002</b> to copy and delete file in applicatio server. You may need BASIS to give permission access to aps server.
Hope this will help.
Regards,
Ferry Lianto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use FM <b>RS_RENAME_PROGRAM </b>
DATA: PROGOLD LIKE SY-REPID VALUE 'ZTEST', "Old prog name
PROGNEW LIKE SY-REPID VALUE 'ZTEST998'. "new prog name
call function 'RS_RENAME_PROGRAM'
exporting devclass = '$TMP'
source_program = progold
program = prognew
suppress_popup = 'X'
exceptions others = 1.
This FM is not for file names in application server.
We can rename program names using this FM.
Regards,
Sailaja.
Message was edited by: Sailaja N.L.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you talking about files on the application server. If so, you will need to copy them into the new name and delete the old one. Here is a sample program.
report zrich_0001.
parameters: d1 type localfile default '/usr/sap/TST/SYS/Data1.txt',
d2 type localfile default '/usr/sap/TST/SYS/Data2.txt'.
data: begin of itab occurs 0,
rec(20) type c,
end of itab.
data: wa(20) type c.
start-of-selection.
* open and read file 1 into an internal table
open dataset d1 for input in text mode.
if sy-subrc = 0.
do.
read dataset d1 into wa.
if sy-subrc <> 0.
exit.
endif.
itab-rec = wa.
append itab.
enddo.
endif.
close dataset d1.
* Open file 2 and copy the contents to this file
open dataset d2 for output in text mode.
loop at itab.
transfer itab to d2.
endloop.
close dataset d2.
* Delete file 1
delete dataset d1.
Welcome to SDN! Please remember to award points for any helpful answers that you might recieve. Also, when your question has been answered completly, be sure to mark as "Solved". Thanks.
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.