Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

problem with rename command in ftp_command

Former Member
0 Likes
1,075

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...

4 REPLIES 4
Read only

Former Member
0 Likes
724

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

Read only

Former Member
0 Likes
724

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..

Read only

0 Likes
724

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)...

Read only

0 Likes
724

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