cancel
Showing results for 
Search instead for 
Did you mean: 

ADOBE Reader Could not Open it is Either not supported File or bcoz file is Damaged

Former Member
0 Kudos

Hello Experts,

good day.

I have a following scenario of creating a email with a PDF attachment,

I run a Program A in background which in turns calls another Program B through Submit Syntax.

The Issue is when a run the Program in Background the Email is getting created in SOST but the PDF Attachment is Corrupted.

But If i run the Program B alone in Debugging mode the Email is getting created with Proper PDF attachment.

I am Using the below Code to Convert the Smartform Output to PDF :

call function 'CONVERT_OTF'

exporting

       format                = 'PDF'

     importing

       bin_filesize          = lv_filesize

       bin_file              = lv_xpdf

tables

       otf                   = ls_job_output-otfdata

       lines                 = lt_otf_lines

exceptions

       err_max_linewidth     = 1

       err_format            = 2

       err_conv_not_possible = 3

       err_bad_otf           = 4

       others                = 5.


Could any one of you , help me Understand what would be the Issue .. Please..


Thanks

GJ

Accepted Solutions (0)

Answers (1)

Answers (1)

aidan_black
Active Contributor
0 Kudos

Hi,

As per SAP note 1320163, you need to use the BIN_FILE parameter in the call to CONVERT_OTF so that it returns the PDF data as type xstring in this parameter BIN_FILE. You should change the call of the module as shown in the sample program BCS_EXAMPLE_8 in SAP note 1324547. This program  BCS_EXAMPLE_8 shows how the returned PDF data can be handled.

regards,
Aidan