11-08-2004 3:08 PM
Do you know anyway to execute an FTP append command from ABAP?
I like FTP_R3_TO_SERVER but it just perform FTP put command (each time target file is replaced).
Sergio
11-08-2004 3:33 PM
The FTP_R3_TO_SERVER is nice because it takes data directly from memory and performs an FTP on it. However it is a little limited in options as you found.
If you don't mind writting your file to your local filesystem first, you can always use the function modules FTP_CONNECT, FTP_COMMAND, and FTP_DISCONNECT. You can string together muliptle calls to FTP_COMMAND to issue all sorts of things. You can use puts, appends, or just about anything you can execute from a FTP command line interface.
11-08-2004 3:33 PM
The FTP_R3_TO_SERVER is nice because it takes data directly from memory and performs an FTP on it. However it is a little limited in options as you found.
If you don't mind writting your file to your local filesystem first, you can always use the function modules FTP_CONNECT, FTP_COMMAND, and FTP_DISCONNECT. You can string together muliptle calls to FTP_COMMAND to issue all sorts of things. You can use puts, appends, or just about anything you can execute from a FTP command line interface.
07-07-2005 3:17 AM
I failed to use FTP_R3_TO_SERVER to transfer data in memory to file in FTP server. My coding is below,
CALL FUNCTION 'FTP_R3_TO_SERVER'
EXPORTING
handle = mi_handle
fname = 'test.txt'
blob_length = 5000
tables
blob = i_tab
The error msg is 'FTP subcommand:local error'. And then the file TEST.TXT is generated in FTP server,but without any data.
Before call this FM I use FTP_CONNECT to access FTP successfully.
I am wondering whether the data in internal table I_TAB should in Binary code or others?
I checked the program RSFTP007 and it seems the data in file is converted like '61666A6C616A666C616A6A66647061757064666A61643B6B663B616B6B6B6B6B6B6B6B6B6B<'.
I guess I should conver the data before transfer.But I don't know how to do.
07-07-2005 5:04 AM
Hi, Thomas Jung
Can I ask you a question?
About the FTP_COMMAND, what kind of FTP command it use?
The FTP client command like 'append' 'delete'?(which is also using in console)
or the raw FTP command like 'APPE' 'DELE'?(which is in FTP protocol)
hope your reply, thanks a lot
07-07-2005 9:33 AM
Gu,
Could you tell me what is the difference between FTP client command and raw FTP command on 'put'?
07-07-2005 11:14 AM
Hi,
These are commands that are supported by FTP_COMMAND.
You can find this list by executing 'help' command using FTP_COMMAND.
! append ascii binary case
cd cdup chmod delete debug
dir get glob help idle
lcd ls mdelete mget mkdir
modtime mput nlist prompt set
put pwd quote rstatus rhelp
rename rmdir site size status
struct system umask
07-07-2005 3:43 PM
Thanks
Then it looks like FTP_COMMAND support the ftp client command.
To Li: the raw ftp commmand is something belong to FTP protocol. They are the packages content send to ftp sever.
Oppositely, client command is the command you type in the console.
E.G. the append command is APPE for raw, and APPEND for client command.
07-07-2005 4:30 PM
By the way, in raw command, there is no 'put' command.
If you interesting in raw command, go this link
http://www.faqs.org/rfcs/rfc959.html
thanks
07-08-2005 1:32 AM
Thanks,gu.
Now the answer to my question on FTP_R3_TO_SERVER is still in vain...
03-01-2006 9:42 AM
i have problem in FTP_R3_TO_SERVER. everything is ok, but created file different from ws_download.i want to publish a text file with 50 rows that created from an internal table. but the generated file has only one row.
here is my code:
in ws_download everything ok.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
filename = 'C:myfile.txt'
filetype = 'DAT'
TABLES
data_tab = formated_output.
*but here all internal table data in one row
DESCRIBE TABLE formated_output LINES tab_lines.
ftp_filename = 'myfile.txt'.
blob_size = tab_lines * 387.
*387:one row lenght
CALL FUNCTION 'FTP_R3_TO_SERVER'
EXPORTING
handle = mi_handle
fname = ftp_filename
blob_length = blob_size
TABLES
blob = formated_output
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3
OTHERS = 4
.
11-12-2007 2:38 PM
If you want to transfer text rather than binary, please ensure to set export parameter to X and use table entry TEXT rather than BLOB, e.g. like this :
CALL FUNCTION 'FTP_R3_TO_SERVER'
EXPORTING
handle = handle
fname = lf_fname
character_mode = 'X' " !!!!
TABLES
text = chardata " !!!!
EXCEPTIONS
tcpip_error = 1
command_error = 2
data_error = 3
OTHERS = 4.