<?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: Regarding FTP_COPY in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ftp-copy/m-p/5016164#M1167303</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;... also the operating service must grant authority to execute ftp command on server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Jan 2009 17:31:21 GMT</pubDate>
    <dc:creator>Clemenss</dc:creator>
    <dc:date>2009-01-07T17:31:21Z</dc:date>
    <item>
      <title>Regarding FTP_COPY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ftp-copy/m-p/5016159#M1167298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written a simiple  code to place a flat file on the application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I have used the function modules HTTP_SCRAMBLE,&lt;/P&gt;&lt;P&gt;FTP_CONNECT,&lt;/P&gt;&lt;P&gt;CTP_COPY,&lt;/P&gt;&lt;P&gt;and finally FTP_DISCONNECT to copy the file from the application server &lt;/P&gt;&lt;P&gt;to the FTP address given to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I am not able to connect.&lt;/P&gt;&lt;P&gt;I am getting the message...  "Attempt to connect to FTP://123...... failed"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am just wondering .... has anything to be set up by  the BASIS Team???&lt;/P&gt;&lt;P&gt;The FTP address given by me is accessible from the outside world. It's public.&lt;/P&gt;&lt;P&gt;It's working . we have checked it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The network team at my client's  place has allowed data to go out from the DEV server.&lt;/P&gt;&lt;P&gt;I am executing the ABAP code from the DEV server using a DEV user id.&lt;/P&gt;&lt;P&gt;However, they are not able to ping from unix command promt of the DEV server. OS is unix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know , if anything has to be configured by the BASIS team.&lt;/P&gt;&lt;P&gt;The following is my code---&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ZTP_HR_FAMILY_DATA.

* INTERNAL TABLES

DATA: BEGIN OF IT0021 OCCURS 0,
        PERNR LIKE P0021-PERNR,    " EMPLOYEE NUMBER
        SUBTY LIKE P0021-SUBTY,   " SUBTYPE
        BEGDA LIKE P0021-BEGDA,   " START DATE
        ENDDA LIKE P0021-ENDDA,   " END DATE
        FANAM LIKE P0021-FANAM,   " LAST NAME
        FAVOR LIKE P0021-FAVOR,   " FIRST NAME
        FASEX LIKE P0021-FASEX,   " GENDER
        FGBDT LIKE P0021-FGBDT,   " DATE OF BIRTH
        FGBOT LIKE P0021-FGBOT,   " BIRTH PLACE
        FGBLD LIKE P0021-FGBLD,   " COUNTRY OF BIRTH
        FANAT LIKE P0021-FANAT,   " NATIONALITY
      END OF IT0021.


DATA: BEGIN OF IT0021_D OCCURS 0,
        PERNR LIKE P0021-PERNR,    " EMPLOYEE NUMBER
        SUBTY LIKE P0021-SUBTY,   " SUBTYPE
        BEGDA LIKE P0021-BEGDA,   " START DATE
        ENDDA LIKE P0021-ENDDA,   " END DATE
        FANAM LIKE P0021-FANAM,   " LAST NAME
        FAVOR LIKE P0021-FAVOR,   " FIRST NAME
        FASEX LIKE P0021-FASEX,   " GENDER
        FGBDT LIKE P0021-FGBDT,   " DATE OF BIRTH
        FGBOT LIKE P0021-FGBOT,   " BIRTH PLACE
        FGBLD LIKE P0021-FGBLD,   " COUNTRY OF BIRTH
        FANAT LIKE P0021-FANAT,   " NATIONALITY
      END OF IT0021_D.

DATA: DATA TYPE STRING.

*DATA: BEGIN OF FINAL1 OCCURS 0,
 *     DATA TYPE STRING,
  *  END OF FINAL1.

DATA: FILE(100) TYPE  C VALUE '/tmp/cnergyis/family3.txt'.


START-OF-SELECTION.

  SELECT *    "pernr
*         subty
*         begda
*         endda
*         fanam
*         favor
*         fasex
*         fgbdt
*         fgbot
*         fgbld
*         fanat
 FROM PA0021 UP TO 10 ROWS  INTO CORRESPONDING FIELDS OF TABLE IT0021.

*  IF sy-subrc EQ 0.
*    WRITE:/ 'DATA IS THERE'.
*  ENDIF.

*IF NOT it0021[] IS INITIAL.
*  SORT it0021 BY pernr.
*ENDIF.


  OPEN  DATASET FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT  . 
  IF SY-SUBRC EQ 0.
    LOOP AT IT0021.
      CONCATENATE IT0021-PERNR
                  IT0021-SUBTY
                  IT0021-BEGDA
                  IT0021-ENDDA
                  IT0021-FANAM
                  IT0021-FAVOR
                  IT0021-FASEX
                  IT0021-FGBDT
                  IT0021-FGBOT
                  IT0021-FGBLD
                  IT0021-FANAT
                  INTO DATA SEPARATED BY '~'.
      TRANSFER DATA TO FILE.
      IF SY-SUBRC EQ 0.
        WRITE:/ 'Row created'.
      ELSE.
        WRITE:/ 'failed'.
      ENDIF.
    ENDLOOP.
  ENDIF.
**

  CLOSE DATASET FILE.
  IF SY-SUBRC NE 0.
    WRITE:/ 'not closed'.
  ELSE.
  write:/ 'closed'.

   DATA: PWD(7) TYPE C VALUE '*****9#',
        SLEN TYPE I VALUE '7',
        KEY TYPE I VALUE 26101957,
  SUSER(13) TYPE C VALUE 'administrator',
        SHOST(100) TYPE C VALUE 'ftp://123.252.134.10',
*        rfc_dest(6) TYPE c VALUE 'SAPFTPA',
        SHDL TYPE I,
        DHDL TYPE I.

  DATA: RESULT TYPE TABLE OF TEXT WITH HEADER LINE.


    CALL FUNCTION 'HTTP_SCRAMBLE'
      EXPORTING
        SOURCE      = PWD
        SOURCELEN   = SLEN
        KEY         = KEY
      IMPORTING
        DESTINATION = PWD.

    IF SY-SUBRC EQ 0.
      WRITE:/ 'PASSWORD SCRAMBLED'.
    ENDIF.
*
    CALL FUNCTION 'FTP_CONNECT'
      EXPORTING
        USER                   = SUSER
        PASSWORD               = PWD
*   ACCOUNT                =
        HOST                   = SHOST
        RFC_DESTINATION        = 'SAPFTP'
*     GATEWAY_USER           = SUSER

*     GATEWAY_PASSWORD       = PWD
*   GATEWAY_HOST           =
     IMPORTING
       HANDLE                 = DHDL
 EXCEPTIONS
   NOT_CONNECTED          = 1
   OTHERS                 = 2
              .
    IF SY-SUBRC &amp;lt;&amp;gt; 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    IF SY-SUBRC EQ 0.
      WRITE:/ 'CONNECTED'.
    ELSE.
      WRITE:/ 'CONNECTION FAILED'.
    ENDIF.


    CALL FUNCTION 'FTP_COPY'
      EXPORTING
        HANDLE_SOURCE            = SHDL
        HANDLE_DESTINATION       = DHDL
        FILE_SOURCE              = FILE
        FILE_DESTINATION         = SHOST
      TABLES
        DATA                     = RESULT
* EXCEPTIONS
*   DATA_ERROR               = 1
*   COMMAND_ERROR            = 2
*   TCPIP_ERROR              = 3
*   OTHERS                   = 4
              .
    IF SY-SUBRC &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    IF SY-SUBRC EQ 0.
      WRITE:/ 'COPIED'.
    ELSE.
      WRITE:/ 'NOT COPIED'.
      WRITE:/ RESULT.
    ENDIF.

    CALL FUNCTION 'FTP_DISCONNECT'
      EXPORTING
        HANDLE = SHDL.
    WRITE:/ 'closed'.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm regards,&lt;/P&gt;&lt;P&gt;Hari Kiran&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: HARI KIRAN REDDY on Jan 7, 2009 4:10 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 12:14 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 10:39:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ftp-copy/m-p/5016159#M1167298</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-07T10:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding FTP_COPY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ftp-copy/m-p/5016160#M1167299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt; run the report RSFTP001 &lt;/P&gt;&lt;P&gt; you can also check  SM59 in order to see the connection for FTP&lt;/P&gt;&lt;P&gt;check this thread &lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1086934"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 10:44:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ftp-copy/m-p/5016160#M1167299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-07T10:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding FTP_COPY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ftp-copy/m-p/5016161#M1167300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rimpa,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for answering.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done all that. &lt;/P&gt;&lt;P&gt;Ran all those RSFTP reports ... we got the same error message.&lt;/P&gt;&lt;P&gt;"Attempt to connect failed "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAFTP looks fine.&lt;/P&gt;&lt;P&gt;Just have a look at my code and let me know if anything looks wrong.&lt;/P&gt;&lt;P&gt;The BASIS adming when he sits and tries to ftp from the Unix command prompt, it's not happening.&lt;/P&gt;&lt;P&gt;They say they have opened the DEV server for outbound though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone clarify this simple doubt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I execute any of those RSFTP series programs and give the destination ip address and the app server&lt;/P&gt;&lt;P&gt;path and as the BASIS team says " DEV server is open for outbound".....&lt;/P&gt;&lt;P&gt;then that RSFTP program should work????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I right about that???&lt;/P&gt;&lt;P&gt;let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanking you again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm regards,&lt;/P&gt;&lt;P&gt;Hari Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 10:54:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ftp-copy/m-p/5016161#M1167300</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-07T10:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding FTP_COPY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ftp-copy/m-p/5016162#M1167301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;inputs please&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;hari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 11:11:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ftp-copy/m-p/5016162#M1167301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-07T11:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding FTP_COPY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ftp-copy/m-p/5016163#M1167302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes thats right.. the RSFTP* program should work with the correct input if BASIS has already opened the connection/ports.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 11:56:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ftp-copy/m-p/5016163#M1167302</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-07T11:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding FTP_COPY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ftp-copy/m-p/5016164#M1167303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;... also the operating service must grant authority to execute ftp command on server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 17:31:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ftp-copy/m-p/5016164#M1167303</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2009-01-07T17:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding FTP_COPY</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ftp-copy/m-p/5016165#M1167304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for  the inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, the admin is not able to ping the ftp path given by me &lt;/P&gt;&lt;P&gt;from his Unix command prompt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's saying" session timed out".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am operating alone at the client 's place.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know what to suggest them&lt;/P&gt;&lt;P&gt;or they need to check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Network guy says DEV server has been allowed for outbound communication.&lt;/P&gt;&lt;P&gt;Then, in that case, they should be able to ping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let's see what happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanking you all again.&lt;/P&gt;&lt;P&gt;Hari Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2009 04:49:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-ftp-copy/m-p/5016165#M1167304</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-09T04:49:24Z</dc:date>
    </item>
  </channel>
</rss>

