cancel
Showing results for 
Search instead for 
Did you mean: 

PDF File is Corrupted or Damaged when the Attachment is Opened

Former Member
0 Kudos

Hello,

I have three Similar forms which are triggered from Sales Order, Delivery & Shipment respectively. Now, the requirement is to send the Form Output as PDF Attachment in a mail. But the Problem I am facing is that the Shipment Output goes as PDF attachment and when opened, it is displayed correctly. However, when the Sales Order & Delivery PDFs are sent as attachments, then the Adobe Reader says

"The File is Corrupted or damaged hence cannot be opened". This is the Message I get when processed from the Delivery. For the Sales Order, the Mail Output triggers with an error in SOST.

We have the Mail Ports open during Testing and I am using the latest version of Adobe Reader. Can someone give me any resolution to handle the Damaged PDF File?

Thanks and Regards,

Venkat Phani Prasad Konduri

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi check this wiki on form to pdf conversion

https://wiki.sdn.sap.com/wiki/x/MYOmAw

Answers (6)

Answers (6)

0 Kudos

Maybe your code is wrong. I have the same problem. This article help me
https://mysapnuts.blogspot.com/2016/09/send-adobe-form-as-email-attachment.html

Former Member
0 Kudos
Former Member
0 Kudos

I don't know if the solution was provided to the one who put this query or not, but i would rather recommend a solution i found this morning while finding a solution to repair my PDF file.

I've download SysInfoTools PDF Recovery tool. But because i downloaded a demo version, i wasn't able to save the repaired file. But i think i'll surely get a license for this. This is wonderful friends, you may prefer this in future.

Former Member
0 Kudos

Query Resolved. Used the CL_BCS class to send mail and its working fine.

Thanks and Regards,

Venkat Phani Prasad Konduri

Former Member
0 Kudos

Dear Freind,

Iam also facing same issue when i have see my inbox iam getting same error as "PDF file is corrupted " could you please tell me how you solve the issue . if possible please give me the code.

regards

vamsi

0 Kudos

Hi,

To resolve this issue, to whom we need to contact. Either Basis or ABAP team. Please suggest.

Former Member
0 Kudos

Hi Konduri,

check the function module 'CONVERT_OTF' have you passed to the other forms.

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

MAX_LINEWIDTH = 132

IMPORTING

BIN_FILESIZE = V_LEN_IN ---> bin_filesize

TABLES

OTF = I_OTF

LINES = I_TLINE

EXCEPTIONS

ERR_MAX_LINEWIDTH = 1

ERR_FORMAT = 2

ERR_CONV_NOT_POSSIBLE = 3

ERR_BAD_OTF = 4.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards,

Sravanthi

Former Member
0 Kudos

Hi,

Use FM CALL FUNCTION 'CONVERT_OTF' instead of CALL FUNCTION 'CONVERT_OTF_2_PDF'.

if you are using CALL FUNCTION 'SCMS_BINARY_TO_XSTRING' to convert internal table obtaining to convert binary to string from CALL FUNCTION 'CONVERT_OTF_2_PDF' FM then comment CALL FUNCTION 'SCMS_BINARY_TO_XSTRING' FM.

Thanks,

Sree.

Former Member
0 Kudos

Hello,

I am using the same Function Module.

Thanks and Regards,

Venkat Phani Prasad Konduri