Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem downloading a PDF via FTP.

Former Member
0 Kudos

I'm trying to send a PDF file via FTP, that I obtained with FM 'CONVERT_OTFSPOOLJOB_2_PDF'.

After closing the FTP connection, i try to open the PDF file, and I get an error message, saying that the file is damaged.

Any ideas? Do I have to make any conversion?

<promise removed by moderator>


DATA: it_pdf TYPE TABLE OF tline WITH HEADER LINE.

CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
  EXPORTING
    src_spoolid   = p_spool
  IMPORTING
    pdf_bytecount = lv_byte
  TABLES
    pdf           = it_pdf.

*--  Connection to FTP (not shown here)
*--  .....

*-- Transfer table
CALL FUNCTION 'FTP_R3_TO_SERVER'
  EXPORTING
    handle         = w_hdl
    fname          = p_dest          "file path of destination system
    blob_length    = lv_byte
*      character_mode = ' '
  TABLES
    blob           = it_pdf
*      text           = lt_value
  EXCEPTIONS
    tcpip_error    = 1.

Thanks in advance,

Maxi.-

Edited by: maxikishi on Feb 10, 2011 8:22 PM

Edited by: Thomas Zloch on Feb 11, 2011 4:41 PM

3 REPLIES 3

Former Member
0 Kudos

I think you have to make some conversions before passing values to FTP function.

Hope it helps.

0 Kudos

what kind of conversion?

Anyone else has an idea?

0 Kudos

Don't offer rewards for assistance; you'll receive help with or without the offer. This topic is an FAQ; FTP is no different than any other transfer method. Search the forum for PDF conversion code. Also, the function you're using has a 99 page limit for conversion; you may want to view the function parameters and account for that.