Skip to Content

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

PDF File to FTP Location

Hi ,

I have to download the PDF file to a FTP location. I am able to download the file to location but when I open the file , I am not able to see the content. But the file size is shown as 64KB.

Also when I download the same to Presentation server it is working fine.

Can anybody let me know what may be the issue.

PDF_TAB is the table with data.

The code used is :

CALL FUNCTION 'HTTP_SCRAMBLE'

EXPORTING

SOURCE = pwd

sourcelen = slen

key = key

IMPORTING

destination = pwd.

CALL FUNCTION 'FTP_CONNECT'

EXPORTING

user = user

password = pwd

host = host

rfc_destination = dest

IMPORTING

handle = hdl.

IF hdl IS INITIAL.

CALL FUNCTION 'FTP_CONNECT'

EXPORTING

user = user

password = pwd

host = host

rfc_destination = dest

IMPORTING

handle = hdl.

ENDIF.

CALL FUNCTION 'FTP_R3_TO_SERVER'

EXPORTING

handle = hdl

fname = g_f_fname

  • BLOB_LENGTH =

character_mode = 'X'

TABLES

  • BLOB = iresult

text = pdf_tab[]

EXCEPTIONS

tcpip_error = 1

command_error = 2

data_error = 3

OTHERS = 4

.

IF sy-subrc <> 0.

MESSAGE e016(pn) WITH text-004.

ENDIF.

CALL FUNCTION 'FTP_DISCONNECT'

EXPORTING

handle = hdl.

CALL FUNCTION 'RFC_CONNECTION_CLOSE'

EXPORTING

destination = dest

EXCEPTIONS

OTHERS = 1.

Your help is really appreciated.

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question