<?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 SAP2FTP? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap2ftp/m-p/3818537#M918353</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts!!&lt;/P&gt;&lt;P&gt;can anybody say me, how I can enter FTP server(with credentials) from SAP system and upload CSV files to SAP system?&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 May 2008 08:54:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-21T08:54:00Z</dc:date>
    <item>
      <title>SAP2FTP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap2ftp/m-p/3818537#M918353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts!!&lt;/P&gt;&lt;P&gt;can anybody say me, how I can enter FTP server(with credentials) from SAP system and upload CSV files to SAP system?&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2008 08:54:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap2ftp/m-p/3818537#M918353</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-21T08:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAP2FTP?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap2ftp/m-p/3818538#M918354</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;The below program is to create file on FTP server by taking the data from internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To see whether the file is created on the FTP server&lt;/P&gt;&lt;P&gt;use the function module FTP_SERVER_TO_R3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You write a same program with the function module FTP_SERVER_TO_R3 instead of &lt;/P&gt;&lt;P&gt;FTP_R3_TO_SERVER to check the existence of the file which is already created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables: t777a. "Building Addresses&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal Table for Building table. &lt;/P&gt;&lt;P&gt;data: begin of it_t777a occurs 0,&lt;/P&gt;&lt;P&gt;build like t777a-build, "Building&lt;/P&gt;&lt;P&gt;stext like t777a-stext, "Object Name&lt;/P&gt;&lt;P&gt;cname like t777a-cname, "Address Supplement (c/o)&lt;/P&gt;&lt;P&gt;ort01 like t777a-ort01, "City&lt;/P&gt;&lt;P&gt;pstlz like t777a-pstlz, "Postal Code&lt;/P&gt;&lt;P&gt;regio like t777a-regio, "Region (State, Province, County)&lt;/P&gt;&lt;P&gt;end of it_t777a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal Table for taking all fields of the above table in one line &lt;/P&gt;&lt;P&gt;separated by u2018|u2019(pipe). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_text occurs 0,&lt;/P&gt;&lt;P&gt;text(131),&lt;/P&gt;&lt;P&gt;end of it_text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Constants: c_key type i value 26101957,&lt;/P&gt;&lt;P&gt;c_dest type rfcdes-rfcdest value 'SAPFTPA'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: g_dhdl type i, "Handle&lt;/P&gt;&lt;P&gt;g_dlen type i, "pass word length&lt;/P&gt;&lt;P&gt;g_dpwd(30). "For storing password&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Selection Screen Starts &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE TEXT-001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_user(30) default 't777a' obligatory,&lt;/P&gt;&lt;P&gt;p_pwd(30) default 't777a' obligatory,&lt;/P&gt;&lt;P&gt;p_host(64) default 'XXX.XXX.XX.XXX' obligatory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK blk1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE TEXT-002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_file like rlgrap-filename default 't777a_feed.txt'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK blk2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Password not visible. &lt;/P&gt;&lt;P&gt;at Selection-screen output.&lt;/P&gt;&lt;P&gt;loop at screen.&lt;/P&gt;&lt;P&gt;if screen-name = 'P_PWD'.&lt;/P&gt;&lt;P&gt;screen-invisible = '1'.&lt;/P&gt;&lt;P&gt;modify screen.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;g_dpwd = p_pwd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start of selection &lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fetch the data records from the table T777A. &lt;/P&gt;&lt;P&gt;select build stext cname ort01 pstlz regio&lt;/P&gt;&lt;P&gt;from t777a&lt;/P&gt;&lt;P&gt;into table it_t777a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort the internal table by build. &lt;/P&gt;&lt;P&gt;if not it_t777a[] is initial.&lt;/P&gt;&lt;P&gt;sort it_t777a by build.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate all the fields of above internal table records in one line &lt;/P&gt;&lt;P&gt;separated by u2018|u2019(pipe). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_t777a.&lt;/P&gt;&lt;P&gt;concatenate it_t777a-build it_t777a-stext it_t777a-cname&lt;/P&gt;&lt;P&gt;it_t777a-ort01 it_t777a-pstlz it_t777a-regio&lt;/P&gt;&lt;P&gt;into it_text-text separated by '|'.&lt;/P&gt;&lt;P&gt;append it_text.&lt;/P&gt;&lt;P&gt;clear it_text.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the length of the password. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;g_dlen = strlen( g_dpwd ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below Function module is used to Encrypt the Password. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'HTTP_SCRAMBLE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;SOURCE = g_dpwd "Actual password&lt;/P&gt;&lt;P&gt;SOURCELEN = g_dlen&lt;/P&gt;&lt;P&gt;KEY = c_key&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;DESTINATION = g_dpwd. "Encyrpted Password&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Connects to the FTP Server as specified by user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call function 'SAPGUI_PROGRESS_INDICATOR'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;text = 'Connecting to FTP Server'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below function module is used to connect the FTP Server. &lt;/P&gt;&lt;P&gt;It Accepts only Encrypted Passwords. &lt;/P&gt;&lt;P&gt;This Function module will provide a handle to perform different &lt;/P&gt;&lt;P&gt;operations on the FTP Server via FTP Commands. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'FTP_CONNECT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;user = p_user&lt;/P&gt;&lt;P&gt;password = g_dpwd&lt;/P&gt;&lt;P&gt;host = p_host&lt;/P&gt;&lt;P&gt;rfc_destination = c_dest&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;handle = g_dhdl&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;NOT_CONNECTED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;format color col_negative.&lt;/P&gt;&lt;P&gt;write:/ 'Error in Connection'.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;write:/ 'FTP Connection is opened '.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**Transferring the data from internal table to FTP Server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'FTP_R3_TO_SERVER'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;HANDLE = g_dhdl&lt;/P&gt;&lt;P&gt;FNAME = p_file&lt;/P&gt;&lt;P&gt;CHARACTER_MODE = 'X'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;TEXT = it_text&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;TCPIP_ERROR = 1&lt;/P&gt;&lt;P&gt;COMMAND_ERROR = 2&lt;/P&gt;&lt;P&gt;DATA_ERROR = 3&lt;/P&gt;&lt;P&gt;OTHERS = 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC 0.&lt;/P&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;write:/ 'File has created on FTP Server'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call function 'SAPGUI_PROGRESS_INDICATOR'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;text = 'File has created on FTP Server'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To Disconnect the FTP Server. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'FTP_DISCONNECT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;HANDLE = g_dhdl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To Disconnect the Destination. &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'RFC_CONNECTION_CLOSE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;destination = c_dest&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;others = 1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 May 2008 09:08:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap2ftp/m-p/3818538#M918354</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-21T09:08:37Z</dc:date>
    </item>
  </channel>
</rss>

