<?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 Re: FTP files in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-files/m-p/5746334#M1302438</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Kiran kumar Wrote :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   File need to fetched from FTP.. &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let say for eg : we have SAP System &lt;STRONG&gt;S&lt;/STRONG&gt; and Non SAP System &lt;STRONG&gt;NS&lt;/STRONG&gt;, which has FTP Server is &lt;/P&gt;&lt;P&gt;192.168.10.10.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, system NS will Download a File to FTP and system S will Upload everyday. This can be done as follow Simple code:&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; Hi,&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_UPLOAD'
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>Mon, 15 Jun 2009 09:56:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-06-15T09:56:43Z</dc:date>
    <item>
      <title>FTP files</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-files/m-p/5746333#M1302437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;File need to fetched from FTP..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is this exactly means&lt;/P&gt;&lt;P&gt;where exactly the file get stored and how it need to picked when sent by some non-sap &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do we have any directory representing as FTP where the file is physically stored and then fetched for processing in abap using idoc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2009 08:48:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-files/m-p/5746333#M1302437</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-15T08:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: FTP files</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-files/m-p/5746334#M1302438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Kiran kumar Wrote :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   File need to fetched from FTP.. &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let say for eg : we have SAP System &lt;STRONG&gt;S&lt;/STRONG&gt; and Non SAP System &lt;STRONG&gt;NS&lt;/STRONG&gt;, which has FTP Server is &lt;/P&gt;&lt;P&gt;192.168.10.10.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, system NS will Download a File to FTP and system S will Upload everyday. This can be done as follow Simple code:&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; Hi,&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_UPLOAD'
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>Mon, 15 Jun 2009 09:56:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-files/m-p/5746334#M1302438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-15T09:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: FTP files</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-files/m-p/5746335#M1302439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to this link..http://docs.google.com/Doc?docid=dfv2hmgs_20cmdgkx29&amp;amp;hl=en&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How fetch the data from the FTP server to internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2009 10:04:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-files/m-p/5746335#M1302439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-15T10:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: FTP files</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-files/m-p/5746336#M1302440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi suneel and avinash&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so we can say that it is like a folder on some server...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So this part of code do we need to write in process code assigned either to inbound or outbond settings&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2009 10:30:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-files/m-p/5746336#M1302440</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-15T10:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: FTP files</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-files/m-p/5746337#M1302441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes..that's right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you talking about the IDOC inbound process Code...Then Process code is triggered whenever system receives the IDOC from other server. Then where is the use of FTP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FTP is used to directly read the data from FTP server. You can refer to the link in my previous post ..and add the code in your program to connect to FTP and upload the data from FTP server to internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2009 10:39:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-files/m-p/5746337#M1302441</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-15T10:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: FTP files</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-files/m-p/5746338#M1302442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi avinash&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to process the incoming idocs in sap&lt;/P&gt;&lt;P&gt;but the files from non-sap in stored on FTP server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how exactly these need to be handled&lt;/P&gt;&lt;P&gt;any report with ftp commands is sufficient for this &lt;/P&gt;&lt;P&gt;but i am having standard formats for the ftp files &lt;/P&gt;&lt;P&gt;DIDPP06E and DIDMM02E&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i have to background scheduling also so that the files are picked automatically&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2009 21:00:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ftp-files/m-p/5746338#M1302442</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-15T21:00:28Z</dc:date>
    </item>
  </channel>
</rss>

