<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error while opening pdf attachment in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-pdf-attachment/m-p/8254272#M1631434</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;    Please check the parameter &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;i_attachment_size = attsize&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; ... If the attachment size or file size is small when compared to the actual then the reported error would turn up. Try increasing the file size and check. Although i have not used OO for sending mails....some hint for overcoming this error, hope this helps you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Oct 2011 12:28:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-10-11T12:28:45Z</dc:date>
    <item>
      <title>Error while opening pdf attachment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-pdf-attachment/m-p/8254267#M1631429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using CL_BCS to send the mail with PDF attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mail is being delivered to the recipent but in some cases PDF is not opening.&lt;/P&gt;&lt;P&gt;It giving error "File is damaged or could not be opened".&lt;/P&gt;&lt;P&gt;I am not getting why this happening with some PDF attachments. I am using the following code to convert data into binary form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	LOOP AT data_bin INTO ls_raw.&lt;/P&gt;&lt;P&gt;             ASSIGN ls_raw-line TO &amp;lt;fs_converter&amp;gt; CASTING.&lt;/P&gt;&lt;P&gt;             CONCATENATE l_xtr &amp;lt;fs_converter&amp;gt; INTO l_xtr IN BYTE MODE.&lt;/P&gt;&lt;P&gt;        ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           IF l_xtr IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;             CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'&lt;/P&gt;&lt;P&gt;               EXPORTING&lt;/P&gt;&lt;P&gt;                 buffer     = l_xtr&lt;/P&gt;&lt;P&gt;               TABLES&lt;/P&gt;&lt;P&gt;                 binary_tab = lt_att_content_hex1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2011 14:47:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-pdf-attachment/m-p/8254267#M1631429</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-10T14:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Error while opening pdf attachment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-pdf-attachment/m-p/8254268#M1631430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it depends on the table DATA_BI has, how do you fill it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2011 15:03:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-pdf-attachment/m-p/8254268#M1631430</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-10T15:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Error while opening pdf attachment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-pdf-attachment/m-p/8254269#M1631431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am fetting thr data from FM  'SCMS_R3DB_GET' in table DATA_BIN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SCMS_R3DB_GET'&lt;/P&gt;&lt;P&gt;             EXPORTING&lt;/P&gt;&lt;P&gt;               crep_id      = crepid "'SOFFDB'&lt;/P&gt;&lt;P&gt;               doc_id       = docid&lt;/P&gt;&lt;P&gt;               mandt        = sy-mandt&lt;/P&gt;&lt;P&gt;               comp_id      = comp_id&lt;/P&gt;&lt;P&gt;             IMPORTING&lt;/P&gt;&lt;P&gt;               binary_flg   = binary_flg&lt;/P&gt;&lt;P&gt;               comp_size    = size&lt;/P&gt;&lt;P&gt;               mimetype     = mimetype&lt;/P&gt;&lt;P&gt;             TABLES&lt;/P&gt;&lt;P&gt;               data_txt     = data_txt&lt;/P&gt;&lt;P&gt;               data_bin     = data_bin&lt;/P&gt;&lt;P&gt;             EXCEPTIONS&lt;/P&gt;&lt;P&gt;               error_import = 1&lt;/P&gt;&lt;P&gt;               error_config = 2&lt;/P&gt;&lt;P&gt;               OTHERS       = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 10:15:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-pdf-attachment/m-p/8254269#M1631431</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-11T10:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Error while opening pdf attachment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-pdf-attachment/m-p/8254270#M1631432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      lr_document = cl_document_bcs=&amp;gt;create_document(&lt;/P&gt;&lt;P&gt;                      i_type = 'RAW'&lt;/P&gt;&lt;P&gt;                      i_text = lt_bodytext&lt;/P&gt;&lt;P&gt;                      i_length = ln_textlength&lt;/P&gt;&lt;P&gt;                      i_subject = l_subject ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      attdoctype = 'pdf'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      attsize = XSTRLEN( l_pdf ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      pdftab = cl_document_bcs=&amp;gt;xstring_to_solix( ip_xstring = l_pdf ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      lr_document-&amp;gt;add_attachment( EXPORTING i_attachment_type = attdoctype&lt;/P&gt;&lt;P&gt;                                             i_attachment_subject = atttitle&lt;/P&gt;&lt;P&gt;                                             i_attachment_size = attsize&lt;/P&gt;&lt;P&gt;                                             i_attachment_language = sy-langu&lt;/P&gt;&lt;P&gt;                                             i_att_content_hex = pdftab ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      send_request = cl_bcs=&amp;gt;create_persistent( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      send_request-&amp;gt;set_document( lr_document ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get sender object&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      sender = cl_sapuser_bcs=&amp;gt;create( sy-uname ).&lt;/P&gt;&lt;P&gt;      send_request-&amp;gt;set_sender( i_sender = sender ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      recipient = cl_cam_address_bcs=&amp;gt;create_internet_address( ic_email_address ).&lt;/P&gt;&lt;P&gt;      send_request-&amp;gt;add_recipient( EXPORTING i_recipient = recipient ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      send_request-&amp;gt;set_send_immediately( 'X' ).&lt;/P&gt;&lt;P&gt;      send_request-&amp;gt;send( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CATCH cx_bcs INTO lr_bcs_exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      lc_text = lr_bcs_exception-&amp;gt;get_text( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MESSAGE lc_text TYPE 'E'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this works for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rahul Wagh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 10:22:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-pdf-attachment/m-p/8254270#M1631432</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-11T10:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error while opening pdf attachment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-pdf-attachment/m-p/8254271#M1631433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Rahul.  But I had done the required changes that you have written but still some of the pdf attachment is not opening, giving the same error that file is damaged and could not be repaired.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 11:55:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-pdf-attachment/m-p/8254271#M1631433</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-11T11:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Error while opening pdf attachment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-pdf-attachment/m-p/8254272#M1631434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;    Please check the parameter &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;i_attachment_size = attsize&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; ... If the attachment size or file size is small when compared to the actual then the reported error would turn up. Try increasing the file size and check. Although i have not used OO for sending mails....some hint for overcoming this error, hope this helps you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 12:28:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-pdf-attachment/m-p/8254272#M1631434</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-11T12:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Error while opening pdf attachment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-pdf-attachment/m-p/8254273#M1631435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this below link will helps you.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdev.co.uk/reporting/rep_spooltopdf.htm" target="test_blank"&gt;http://www.sapdev.co.uk/reporting/rep_spooltopdf.htm&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;kishore&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 14:01:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-while-opening-pdf-attachment/m-p/8254273#M1631435</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-11T14:01:11Z</dc:date>
    </item>
  </channel>
</rss>

