<?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: CX_DOCUMENT_BCS Exception was caught in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cx-document-bcs-exception-was-caught/m-p/7215629#M1523169</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;the PDF is in binary form so I don't understand why you multiply size by two. Have you tried with lines * 255. What exception do you get? You can debug that method to see what error is returned by FM SO_ATTACHMENT_INSERT_API1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Aug 2010 00:33:31 GMT</pubDate>
    <dc:creator>mvoros</dc:creator>
    <dc:date>2010-08-04T00:33:31Z</dc:date>
    <item>
      <title>CX_DOCUMENT_BCS Exception was caught</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cx-document-bcs-exception-was-caught/m-p/7215628#M1523168</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 am calling the CL_BCS class to send the PDF mail.The below are the points i have coded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) From Script close_form get the OTF data and convert the Otf data to PDF using callfunction Convert_otf.&lt;/P&gt;&lt;P&gt;2) Then using the   CALL METHOD cl_document_bcs=&amp;gt;xstring_to_solix converting xstring data to PDF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
/ Creates persistent send request
  TRY.
      l_send_request = cl_bcs=&amp;gt;create_persistent( ).


*/ Creating Document
concatenate VBRK-VKORG 'delivery note' VBRP-VGBEL '-XXX' into subject separated by space.

      l_document = cl_document_bcs=&amp;gt;create_document(
                                    i_type    = 'RAW'
                                    i_subject = subject
                                    i_text    = i_content[] ).


      i_attach_pdf[] = lt_mess_att[].

*/ Get the Total Number of Lines.
      DESCRIBE TABLE i_attach_pdf[]  LINES l_lines.

*/ Size to multiplied by 2 for UNICODE enabled systems

      l_size = l_lines * 2 * 255.

*/ Adding Attachment

     *CALL METHOD l_document-&amp;gt;add_attachment*
        EXPORTING
          i_attachment_type    = 'PDF'
          i_attachment_size    = l_size
          i_attachment_subject = 'OSCS Commercial Invc'
          i_att_content_hex    = i_attach_pdf[] &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above method CALL METHOD l_document-&amp;gt;add_attachment it is giving the exception,it has worked well before some patches are applied to the system Now it is throwing an exception.is there any SAP note is available for the same or is there any bug in my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Aug 2010 00:13:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cx-document-bcs-exception-was-caught/m-p/7215628#M1523168</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-04T00:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: CX_DOCUMENT_BCS Exception was caught</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cx-document-bcs-exception-was-caught/m-p/7215629#M1523169</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;the PDF is in binary form so I don't understand why you multiply size by two. Have you tried with lines * 255. What exception do you get? You can debug that method to see what error is returned by FM SO_ATTACHMENT_INSERT_API1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Aug 2010 00:33:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cx-document-bcs-exception-was-caught/m-p/7215629#M1523169</guid>
      <dc:creator>mvoros</dc:creator>
      <dc:date>2010-08-04T00:33:31Z</dc:date>
    </item>
  </channel>
</rss>

