2005 Jul 22 9:17 PM
Hi SAPients.
How can I rename a file in the application server?
I'm working with 46C under SunOS.
Thank you!
2005 Jul 22 9:28 PM
You can define external command with SM69 transaction and then execute it via SXPG_COMMAND_EXECUTE function module. For this particular task you should use an appropriate Unix command for file renaming.
Hi SAPients.
How can I rename a file in the application server?
I'm working with 46C under SunOS.
Thank you!
2005 Jul 22 9:28 PM
You can define external command with SM69 transaction and then execute it via SXPG_COMMAND_EXECUTE function module. For this particular task you should use an appropriate Unix command for file renaming.
2005 Jul 23 12:41 AM
That's a good solution, it would solve my problem but I don't have maintenance authorization in transaction SM69. Another idea?
Thank you!
2005 Jul 23 9:34 AM
Certainly it depends on your corporate authorization policy, may be you yourself should apply for the authorization or request your sysadmin to create SM69 command for you. Also check on-line help on that function as it also has authorization check inside the code.
2009 Feb 17 4:44 PM
Hello
I do have the access to SM69, I am using Unix server so If want to call the FM SXPG_COMMAND_EXECUTE where I have to rename the file , what parameters I need to pass to this
What logical command & Operating System commadn we need to define
Regards,
Prashant
2009 Feb 17 9:17 PM
another idea: if ur unix file name is unix_file1, then, u need to rename it to unix_file2, so, copy the file1 to file2(by using FM, which is like with key words of COPY, SERVER etc, i dont hv sap access).....then delete the file1.
thanq
2009 Feb 18 4:51 PM
Hello,
cp unix command to copy is working fine in SM69 but the similar mv command is not working.
mv is also used for rename of the file.
My requirement is not to copy , bt just to rename the file.
Regards
Prashant
2005 Jul 23 12:05 PM
Hi,
Try the below code:
CONCATENATE 'mv' <old filename> ' '
<new filename> INTO W_COMMAND-LINE SEPARATED BY SPACE.
PERFORM CALL-PIPE.
-
FORM CALL-PIPE.
CALL FUNCTION 'RFC_REMOTE_PIPE'
DESTINATION 'SERVER_EXEC'
EXPORTING
COMMAND = W_COMMAND-LINE
READ = 'X'.
TABLES
PIPEDATA = DIR_TABLE.
ENDFORM. " CALL_PIPE
-
You need to change the 'command' according to your operating system.
Rgds,
Anji
Message was edited by: Anjikumar
2005 Jul 24 5:57 PM
That's exactly the FM I wanted to use but for some "strange reason" (security policies?) when I try to find RFC_REMOTE_PIPE in SE37 system responds with "Function module RFC_REMOTE_PIPE does not exist". Any other idea?
Did I mention that I'm working with SAP 46C and SunOS?
Thank you.
2005 Jul 27 4:27 PM
RFC_REMOTE_PIPE does not appear in SM37 because it is embended in the executable rfcexec.
You can see it in SM59 -> TCP/IP Connection -> SERVER_EXEC -> System Information -> Function list.
If I was you I will follow Sergei's recommendation. It is longer to code but Logical commands (SM69)combined with SXPG_COMMAND_EXECUTE insure portabilty between different OSs and offer SAP Security features. This is the cleanest way to do it.
Note: features of rfcexec changed from rel. to rel. (kernel).
2009 Feb 17 9:18 PM
another idea: if ur unix file name is unix_file1, then, u need to rename it to unix_file2, so, copy the file1 to file2(by using FM, which is like with key words of COPY, SERVER etc, i dont hv sap access).....then delete the file1.
thanq
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |