2008 Aug 13 10:11 AM
Hello all.....
I am having a requirment as i need to change the file name dynamically................
I will be having a file in the application or presentation server. While processing the datat in the file, I need to add extension to the file name as transfer. when the transfer of data is finished the i need to add ok to the file name at last......
Is there any function module or class for changing the file name dynamically or renamig the file name..
Thank You very much in Advance.....
2008 Aug 13 10:19 AM
hii
go through this link
http://saplab.blogspot.com/2007/10/sample-program-to-dynamically-change.html
thanks
Hello all.....
I am having a requirment as i need to change the file name dynamically................
I will be having a file in the application or presentation server. While processing the datat in the file, I need to add extension to the file name as transfer. when the transfer of data is finished the i need to add ok to the file name at last......
Is there any function module or class for changing the file name dynamically or renamig the file name..
Thank You very much in Advance.....
2008 Aug 13 10:19 AM
hii
go through this link
http://saplab.blogspot.com/2007/10/sample-program-to-dynamically-change.html
thanks
2008 Aug 13 10:32 AM
Hi,
I think there is no FM to rename the file. So that try the below steps.
1. if you are processing, manulay you have to append the text 'transfer' when processing the file.
2. once the file has been processed, then again manullay change the file name with addition 'OK' and call the FM
'SCMS_FILE_COPY', here you have to specify the source and target file name with path. once the file copied then delete the source file.
SCMS_FILE_DELETE - Delete
and check the class cl_gui_frontend_services
Regards,
Boobalan S
2008 Aug 13 11:05 AM
Is there any function module to rename the file or copy the file or delete the file in application layer ????????
Function module or class to rename the file in the application layer ..............
2008 Aug 13 11:41 AM
Hi,
Check the Function Module "PFL_COPY_OS_FILE".
Hope it helps.
Murthy
2008 Aug 13 2:12 PM
2008 Aug 13 2:14 PM
Is there any FM to copy the file in Application layer and delete the file in application layer
2008 Aug 13 11:55 AM
HI
Try using
CONCATENATE 'mv' old_filename ' '
new_filename INTO wf_parameter SEPARATED BY space.
CALL FUNCTION 'RFC_REMOTE_PIPE'
DESTINATION 'SERVER_EXEC'
EXPORTING
command = wf_parameter
read = 'X'.
2008 Aug 13 2:19 PM
If your application server is Unix then we can use unix command to Rename your file.
mv -> move command
mv source target
file1 souce file name with path
file2 target filename with path.
REPORT ZUNIX line-size 400
no standard page heading.
data: unixcom like rlgrap-filename.
unixcom = 'mv file1 file2'.
data: begin of tabl occurs 500,
line(400),
end of tabl.
data: lines type i.
*----------------------------------------------------------------------
start-of-selection.
refresh tabl.
call 'SYSTEM' id 'COMMAND' field unixcom
id 'TAB' field tabl[].
For Renaming the Presentation sever
First copy the file to another file and then Delete the old file.
Calss : CL_GUI_FRONTEND_SERVICES
Methods: FILE_COPY
FILE_DELETE
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |