<?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: Passive FTP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/passive-ftp/m-p/2916554#M686645</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chun,&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal Table for  Building table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal Table for taking all fields of the above table in one line&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;separated by &amp;#145;|&amp;#146;(pipe).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;&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;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Selection Screen Starts&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Password not visible.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Start of selection&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;To fetch the data records from the table T777A.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sort the internal table by build.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Concatenate all the fields of above internal table records in one line&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;separated by &amp;#145;|&amp;#146;(pipe).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt; To get the length of the password.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&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;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Below Function module is used to Encrypt the Password.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&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;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Below function module is used to connect the FTP Server.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;It Accepts only Encrypted Passwords.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;This Function module will provide a handle to perform different&lt;/P&gt;&lt;/LI&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;operations on the FTP Server via FTP Commands.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&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 &amp;lt;&amp;gt; 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;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;To Disconnect the FTP Server.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&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;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;To Disconnect the Destination.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&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, 10 Oct 2007 09:28:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-10T09:28:34Z</dc:date>
    <item>
      <title>Passive FTP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passive-ftp/m-p/2916553#M686644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;  How can i establish a passive FTP connection with FTP FM in R/3??&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2007 09:25:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passive-ftp/m-p/2916553#M686644</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-10T09:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Passive FTP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passive-ftp/m-p/2916554#M686645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chun,&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal Table for  Building table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal Table for taking all fields of the above table in one line&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;separated by &amp;#145;|&amp;#146;(pipe).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;&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;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Selection Screen Starts&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Password not visible.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Start of selection&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;To fetch the data records from the table T777A.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sort the internal table by build.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Concatenate all the fields of above internal table records in one line&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;separated by &amp;#145;|&amp;#146;(pipe).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt; To get the length of the password.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&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;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Below Function module is used to Encrypt the Password.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&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;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Below function module is used to connect the FTP Server.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;It Accepts only Encrypted Passwords.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;This Function module will provide a handle to perform different&lt;/P&gt;&lt;/LI&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;operations on the FTP Server via FTP Commands.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&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 &amp;lt;&amp;gt; 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;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;To Disconnect the FTP Server.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&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;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;To Disconnect the Destination.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&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, 10 Oct 2007 09:28:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passive-ftp/m-p/2916554#M686645</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-10T09:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Passive FTP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passive-ftp/m-p/2916555#M686646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your code.  Is it a passive connection??&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2007 09:32:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passive-ftp/m-p/2916555#M686646</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-10T09:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Passive FTP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passive-ftp/m-p/2916556#M686647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont know about passive connection..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2007 09:58:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passive-ftp/m-p/2916556#M686647</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-10T09:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Passive FTP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passive-ftp/m-p/2916557#M686648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thx for your reply.  i have found the solution by using "set passive on" command.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Oct 2007 03:21:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passive-ftp/m-p/2916557#M686648</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-11T03:21:58Z</dc:date>
    </item>
  </channel>
</rss>

