2011 Oct 24 7:24 AM
Hi ABAPERs.
I've been searching any information about how to send a content, stored in an internal table of an ABAP program, to a FTP server., but I haven't been able to find such info.
Is it there any FM to do such work or I should download it to application server (or presentation server, better in app server 'cause process is in background)? The problem is that we're having a lot of problems in the dataset downloading.
Thanks a lot.
2011 Oct 24 9:42 AM
I think I haven't explained correctly (sorry for my English).
The problem is that NOW we are downloading (transferring dataset) to the Application Server and we're having some problems with both code-page transformations and line-feed management.
So, what we want to avoid is transferring dataset to app server and send the content of the internal table to FTP directly.
Thanks.
2011 Oct 24 7:40 AM
Hi,
use open dataset , transfer dataset commands to transfer to application server
Thanks & regards
2011 Oct 24 7:47 AM
Hi,
After HTTP_SCRAMBLE and FTP_CONNECT functions. Use these functions one by one .
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
handle = mi_handle
command = 'ascii'
TABLES
data = mtab_data "internal table
EXCEPTIONS
tcpip_error = 1
command_error = 2
data_error = 3
OTHERS = 4.
then set folder path
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
handle = mi_handle
command = 'cd /company/' "command contains a space
TABLES
data = mtab_data
EXCEPTIONS
tcpip_error = 1
command_error = 2
data_error = 3
OTHERS = 4.
set a filename and call put command.
filename LIKE rlgrap-filename.
CONCATENATE
'TCK71' "pattern
sy-datum
'.txt' INTO filename
CONCATENATE 'put' filename INTO command SEPARATED BY space.
"then call
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
handle = mi_handle
command = command
TABLES
data = mtab_data
EXCEPTIONS
tcpip_error = 1
command_error = 2
data_error = 3
OTHERS = 4.
don t forget close connection. use FTP_DISCONNECT
Take care.
Çağatay
2011 Oct 24 9:42 AM
I think I haven't explained correctly (sorry for my English).
The problem is that NOW we are downloading (transferring dataset) to the Application Server and we're having some problems with both code-page transformations and line-feed management.
So, what we want to avoid is transferring dataset to app server and send the content of the internal table to FTP directly.
Thanks.
2011 Oct 24 1:17 PM
Check standard programs RSFTP007 and RSFTP004.
Or this link:
http://wiki.sdn.sap.com/wiki/display/ABAP/FTPfiletransferinBackground
2011 Oct 24 2:26 PM
Thanks, Roy.
Seems to be a very helpful answer... I was told that such FM was not for such action.
Anyway, if it finally works, I'll give you the full reward.
Kind Regards.
2024 Jul 03 8:45 AM
Hello,
Do we have a solution here.
As I am not able to send internal table data to FTP folder in background mode.
Foreground is working fine, File is created in FTP folder.