<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic interface using ftp in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/interface-using-ftp/m-p/5951212#M1336151</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please give me an idea about the code of ftp interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can u give some code for customer data or any others?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jul 2009 08:57:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-23T08:57:31Z</dc:date>
    <item>
      <title>interface using ftp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interface-using-ftp/m-p/5951212#M1336151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please give me an idea about the code of ftp interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can u give some code for customer data or any others?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2009 08:57:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interface-using-ftp/m-p/5951212#M1336151</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-23T08:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: interface using ftp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interface-using-ftp/m-p/5951213#M1336152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhijit Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Example : &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : v_handle TYPE i.

CONSTANTS: cs_key_500098 TYPE i VALUE '500098'.
DATA: it_itab(255) OCCURS 0 WITH HEADER LINE.
DATA: v_password(20) TYPE c,
i_key TYPE i VALUE 500098,
v_pwd_len TYPE i,
DATA: v_key TYPE i.

v_password = 'youreoneh'.
v_pwd_len = STRLEN( v_password ). and a constant key has to be passed.

CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = v_password
sourcelen = v_pwd_len
key = cs_key_500098
IMPORTING
destination = v_password.

Then :

CALL FUNCTION 'FTP_CONNECT'
EXPORTING
user = 'user_name'
password = v_password
host = '192.168.10.10' " for example
rfc_destination = 'SUNRFC' " for example
IMPORTING
handle = v_handle
EXCEPTIONS
not_connected = 1
OTHERS = 2.

Then : CONCATENATE sy-datum SY-TZONE '.txt' INTO v_filename.
CONCATENATE '//192.168.10.10/sap file/' v_filename INTO v_filename .

then use the 
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = v_filename
write_field_separator = 'X'
TABLES
data_tab = ta_download
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.

"Then finally Disconnect the connection:
CALL FUNCTION 'FTP_DISCONNECT'
EXPORTING
handle = v_handle
EXCEPTIONS
OTHERS = 1.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suneel G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2009 09:16:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interface-using-ftp/m-p/5951213#M1336152</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-23T09:16:25Z</dc:date>
    </item>
  </channel>
</rss>

