2009 Nov 11 5:18 AM
Hi Experts,
I have a program where it sends an email to the customer with a PDF file as an attachment. But in one scenario the attachment couldnot be opened. While trying to open the pdf file it shows an error 'Adobe reader couldnot open the file because either it is not a supported file or because the file has been damaged'.
As we are not able to reproduce the same issue in Development we are not able to find the exact reason for this. Can you please give me some points which possibly could be the reasons for this error.
Hi Experts,
I have a program where it sends an email to the customer with a PDF file as an attachment. But in one scenario the attachment couldnot be opened. While trying to open the pdf file it shows an error 'Adobe reader couldnot open the file because either it is not a supported file or because the file has been damaged'.
As we are not able to reproduce the same issue in Development we are not able to find the exact reason for this. Can you please give me some points which possibly could be the reasons for this error.
2009 Nov 11 6:21 AM
hi,
it means that pdf file doesn't have data or does not exits.
please provide some more technical information to give better answer.
regards,
padmaja
2009 Nov 11 6:45 AM
Hi Padmajavaddi ,
I have checked and the data to be converted is present.
What technical details should i provide you.
Thanks for your valuable time
2011 Aug 30 11:54 AM
Did you recently upgrade the system? SAP note 787418 should be able to help you on this.
2011 Aug 30 12:38 PM
hi ,
I have faced the same problem , but i solved it using OOPS .
You can use it.Below is the code
TRY.
-------- create persistent send request ------------------------
send_request = cl_bcs=>create_persistent( ).
-------- create and set document -------------------------------
pdf_content1 = cl_document_bcs=>xstring_to_solix( bin_file1 ).
READ TABLE i_packing_list INDEX 1.
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = li_text
i_subject = l_mtitle ).
READ TABLE i_packing_list INDEX 2.
document->add_attachment( i_attachment_type = 'PDF'
i_attachment_subject = l_mtitle1
i_att_content_hex = pdf_content1 ).
add document object to send request
send_request->set_document( document ).
--------- add recipient (e-mail address) -----------------------
create recipient object
recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
add recipient object to send request
send_request->add_recipient( i_recipient = recipient
i_express = 'X' i_copy = lx_copy ).
send_request->add_recipient( recipient ).
---------- send document ---------------------------------------
sent_to_all = send_request->send( i_with_error_screen = 'X' ).
CATCH cx_bcs INTO bcs_exception.
ENDTRY.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |