<?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: Email excel attachment using BCS classes in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/email-excel-attachment-using-bcs-classes/m-p/7213983#M1522956</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ivan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement here is, I have data in internal table and this internal table data has to be sent as an email in excel format. I made use of the standard BCS classes SAP provided and was able to successfully send the excel attachment but the columns here are not auto-fit according to the field width. I used the following classes to send data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below class what it does is, it converts the data in string(LV_STRING) into binary_content.  &lt;/P&gt;&lt;P&gt;  TRY.&lt;/P&gt;&lt;P&gt;      cl_bcs_convert=&amp;gt;string_to_solix(&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          iv_string   = lv_string&lt;/P&gt;&lt;P&gt;          iv_codepage = '4103'      "suitable for MS Excel, leave empty for other doc types&lt;/P&gt;&lt;P&gt;          iv_add_bom  = 'X'&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          et_solix  = binary_content&lt;/P&gt;&lt;P&gt;          ev_size   = size ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CATCH cx_bcs.&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above binary content is transformed into excel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Add the spread sheet as attachment to document object&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      document-&amp;gt;add_attachment(&lt;/P&gt;&lt;P&gt;        i_attachment_type    = 'xls'&lt;/P&gt;&lt;P&gt;        i_attachment_subject = 'Excel_Attachment_Name'&lt;/P&gt;&lt;P&gt;        i_attachment_size    = size&lt;/P&gt;&lt;P&gt;        i_att_content_hex    = binary_content).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Add document object to send request&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      send_request-&amp;gt;set_document( document ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The links provided by you are very interesting but does not fulfill my requirement. Thanks and appreciate more responses.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Sep 2010 04:22:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-09-03T04:22:17Z</dc:date>
    <item>
      <title>Email excel attachment using BCS classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/email-excel-attachment-using-bcs-classes/m-p/7213981#M1522954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using BCS classes to send excel attachment in an mail. Everything is working fine except the Auto fit functionality of the columns. When the user opens the excel attachment he wants to see the columns width to be autofit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Sep 2010 14:17:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/email-excel-attachment-using-bcs-classes/m-p/7213981#M1522954</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-02T14:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Email excel attachment using BCS classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/email-excel-attachment-using-bcs-classes/m-p/7213982#M1522955</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;&lt;/P&gt;&lt;P&gt;check this SDN Blog [abap2xlsx - Generate your professional Excel spreadsheet from ABAP|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/20046] &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt;; could be useful to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Sep 2010 22:16:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/email-excel-attachment-using-bcs-classes/m-p/7213982#M1522955</guid>
      <dc:creator>_IvanFemia_</dc:creator>
      <dc:date>2010-09-02T22:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Email excel attachment using BCS classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/email-excel-attachment-using-bcs-classes/m-p/7213983#M1522956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ivan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement here is, I have data in internal table and this internal table data has to be sent as an email in excel format. I made use of the standard BCS classes SAP provided and was able to successfully send the excel attachment but the columns here are not auto-fit according to the field width. I used the following classes to send data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below class what it does is, it converts the data in string(LV_STRING) into binary_content.  &lt;/P&gt;&lt;P&gt;  TRY.&lt;/P&gt;&lt;P&gt;      cl_bcs_convert=&amp;gt;string_to_solix(&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          iv_string   = lv_string&lt;/P&gt;&lt;P&gt;          iv_codepage = '4103'      "suitable for MS Excel, leave empty for other doc types&lt;/P&gt;&lt;P&gt;          iv_add_bom  = 'X'&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          et_solix  = binary_content&lt;/P&gt;&lt;P&gt;          ev_size   = size ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CATCH cx_bcs.&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above binary content is transformed into excel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Add the spread sheet as attachment to document object&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      document-&amp;gt;add_attachment(&lt;/P&gt;&lt;P&gt;        i_attachment_type    = 'xls'&lt;/P&gt;&lt;P&gt;        i_attachment_subject = 'Excel_Attachment_Name'&lt;/P&gt;&lt;P&gt;        i_attachment_size    = size&lt;/P&gt;&lt;P&gt;        i_att_content_hex    = binary_content).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Add document object to send request&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      send_request-&amp;gt;set_document( document ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The links provided by you are very interesting but does not fulfill my requirement. Thanks and appreciate more responses.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Sep 2010 04:22:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/email-excel-attachment-using-bcs-classes/m-p/7213983#M1522956</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-03T04:22:17Z</dc:date>
    </item>
  </channel>
</rss>

