Skip to Content
avatar image
Former Member

writing an xml file to FTP Server

Dear Experts,

Iam using the class CL_XML_DOCUMENT to create an xml document out of my itab in an ABAP report.

This file needs to be put in to an ftp server as an xml file.

Iam not sure how to go about it.

Could anyone suggest me how to put the file on the FTP server.

The class has a "export_to_file" method where one has to give a path name.

Any Pointers would be greatly appreciated

Thanks

P

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Mar 26, 2012 at 03:06 AM

    Hi Arun ,

    U can try like this.....

    gd_slen = STRLEN( p_pwd ).

    CALL FUNCTION 'HTTP_SCRAMBLE'

    EXPORTING

    SOURCE = p_pwd

    sourcelen = gd_slen

    key = gd_key

    IMPORTING

    destination = p_pwd.


    CALL FUNCTION 'FTP_CONNECT'

    EXPORTING

    user = p_user

    password = p_pwd

    host = p_host

    rfc_destination = p_dest

    IMPORTING

    handle = gd_hdl.


    CALL FUNCTION 'FTP_COMMAND'

    EXPORTING

    handle = gd_hdl

    command = 'ascii'

    TABLES

    data = it_result

    EXCEPTIONS

    tcpip_error = 1

    command_error = 2

    data_error = 3.


    CALL FUNCTION 'FTP_R3_TO_SERVER'

    EXPORTING

    handle = gd_hdl

    fname = gd_fname

    blob_length = l_count

    character_mode = 'X'

    TABLES

    text = it_final

    EXCEPTIONS

    TCPIP_ERROR = 1

    COMMAND_ERROR = 2

    DATA_ERROR = 3.


    if sy-subrc = 0.

    write: / 'File uploaded:', gd_fname.

    endif.

    Regards,

    Yukti

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 25, 2012 at 08:25 AM

    Hi Arun,

    I don't think the method, export_to_file will work to put file in FTP as the FTP needs host name,port name and user credentials.

    The following blog may help you:

    http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP+solution+to+implement+FTP+transactions

    Cheers,

    Samir

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 24, 2012 at 11:06 PM
    Add comment
    10|10000 characters needed characters exceeded