Skip to Content
author's profile photo Former Member
Former Member

Getting the contents of a file...

Hi All,

I have to process a file which is residing in the ftp server.

Is there any way of processing the data of the file without the need to write to my application server?

Regards,

Rajasekhar dinavahi

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2005 at 06:40 PM

    see below link

    /people/thomas.jung3/blog/2004/11/15/performing-ftp-commands-from-abap

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2005 at 06:39 PM

    Hi,

    You can do so.

    CONSTANTS: c_dest TYPE rfcdes-rfcdest VALUE 'SAPFTP',

    c_key TYPE i VALUE 26101957.

    l_slen = STRLEN( p_pwd ).

    CALL FUNCTION 'HTTP_SCRAMBLE'

    EXPORTING

    SOURCE = p_pwd

    sourcelen = l_slen

    key = c_key

    IMPORTING

    destination = p_pwd.

    CALL FUNCTION 'FTP_CONNECT'

    EXPORTING

    user = p_user

    password = p_pwd

    host = p_host

    rfc_destination = c_dest

    IMPORTING

    handle = l_hdl

    EXCEPTIONS

    OTHERS = 1.

    IF sy-subrc <> 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ENDIF.

    • DERIVE ALL THE FILES IN '/PUB/INBOX' FOLDER.

    CALL FUNCTION 'FTP_COMMAND'

    EXPORTING

    handle = l_hdl

    command = l_cmd

    TABLES

    data = l_result

    EXCEPTIONS

    tcpip_error = 1

    command_error = 2

    data_error = 3

    OTHERS = 4.

    IF sy-subrc <> 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ENDIF.

    You need to have FTP server user id and password.

    thanks

    sharmistha

    Message was edited by: Sharmistha Parida

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.