‎2007 May 14 6:34 AM
hi all ,
i am facing a problem in renaming a file by rename command...
this is how i am calling the fm ftp_command
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
handle = g_handle
command = 'RENAME l_templine_file l_templine_file1'
TABLES
data = l_i_temp_line
EXCEPTIONS
tcpip_error = 1
command_error = 2
data_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
here l_templine_file - dev00227.header.tmp
l_templine_file1 - dev00227.header.txt
the fm is failing that the error meassage is FTP subcommand error
can u suggest where i am going wrong in this...
‎2007 May 14 6:56 AM
hi,
May be the command you are passing is incorrect syntax..
Pass the values like this..
l_templine_file = 'c:\dev00227.header.tmp' " this should be with path'
l_templine_file1 = 'dev00227.header.txt'" this is just the name of file
If not worked..then Try writing in small letters//
write
command = 'rename l_templinefile l_templine1'.
rewards if useful
Hope this solves..
regards,
nazeer
Message was edited by:
nazeer shaik
Message was edited by:
nazeer shaik
Message was edited by:
nazeer shaik
‎2007 May 14 7:49 AM
Hi,
CONCATENATE ' rename ' G_FILE_NAME G_FILE_NAME_NEW INTO
G_CMND SEPARATED BY SPACE.
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
HANDLE = G_HANDLE
COMMAND = G_CMND
TABLES
DATA = MTAB_DATA
EXCEPTIONS
COMMAND_ERROR = 1
TCPIP_ERROR = 2.
IF SY-SUBRC <> 0.
P_ERROR = C_X.
ENDIF.
ENDFORM.
Give the complete path for file names in G_FILE_NAME and G_FILE_NAME_NEW
hope this will resolve your problem.
reward if needful..
‎2007 May 14 8:35 AM
hi ramesh,
can u tell me is it a good method to run cd command before rename command..(in cd i will give the directory where my file is stored ) and then in the rename command i can give just the old and new file names(withot path name)...
‎2007 May 14 10:08 AM
Hi,
Better to use 'cd' and 'lcd' commands to set remote folder path and local folder path so that you can give directly(only) file name instead of giving complete path for file name