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: 

Error while downloading PDF file from FTP Server

Former Member
0 Kudos

Hi Friends,

I have sent a PDF file with data to FTP , Then i want to check that uploaded pdf file , whether that is correct or not?

for that , i have downloaded that file from FTP and i am trying to open the file . but it is giving this problem .

"There was an error opening the document . The file is damaged and could not be repaired."

will you suggest me regarding this.

thanks in advance.

balaji.T.

4 REPLIES 4

Former Member
0 Kudos

Has this file been moved using ABAP coding? If so, please provide the source code for review.

0 Kudos

CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'

EXPORTING

  • SRC_SPOOLID = spoolno

src_spoolid = wa_file-rqident

no_dialog = ' '

  • DST_DEVICE =

  • PDF_DESTINATION =

IMPORTING

pdf_bytecount = numbytes

pdf_spoolid = pdfspoolid

  • OTF_PAGECOUNT =

btc_jobname = jobname

btc_jobcount = jobcount

TABLES

pdf = pdf

EXCEPTIONS

err_no_otf_spooljob = 1

err_no_spooljob = 2

err_no_permission = 3

err_conv_not_possible = 4

err_bad_dstdevice = 5

user_cancelled = 6

err_spoolerror = 7

err_temseerror = 8

err_btcjob_open_failed = 9

err_btcjob_submit_failed = 10

err_btcjob_close_failed = 11.

because of this one PDF internal table is obtained.

OPEN DATASET L_FILENAME FOR OUTPUT in text mode MESSAGE MSG.

LOOP AT pdf.

CONCATENATE pdf-tdformat "Material group

pdf-TDLINE "Basic Material

INTO ITEXT-TLINE ..

APPEND ITEXT.

TRANSFER ITEXT TO L_FILENAME.

ENDLOOP.

0 Kudos

Do this instead:

LOOP AT pdf.

move '*' to pdf-tdformat.

move pdf-TDLINE to TO ITEXT-TLINE .

APPEND ITEXT.

TRANSFER ITEXT TO L_FILENAME.

ENDLOOP.

0 Kudos

Also - OPEN DATASET L_FILENAME FOR OUTPUT in BINARY mode MESSAGE MSG.