Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

Tags:
Former Member
Former Member replied

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

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question