<?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: Using BCS classes to send emails with attachments in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-bcs-classes-to-send-emails-with-attachments/m-p/846383#M45307</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you !&lt;/P&gt;&lt;P&gt;This is the solution (edited from 'This seems to be the answer'.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also discovered (&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="12963"&gt;&lt;/A&gt;) the function SO_DOCUMENT_SEND_API1 that enables one to specify the sender as well. I knew only SO_NEW_DOCUMENT_ATT_SEND_API1 but the problem was that in the sent email &amp;#145;From&amp;#146; shows the email of the user &amp;lt;name@company.com&amp;gt; who executed the program that called this function and I needed in &amp;#145;From&amp;#146; to be a generic email address something like contact@company.com.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because of that I tried to use BCS classes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Mihai Olaru&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Jan 2005 09:00:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-01-25T09:00:26Z</dc:date>
    <item>
      <title>Using BCS classes to send emails with attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-bcs-classes-to-send-emails-with-attachments/m-p/846381#M45305</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;Basically, the code looks like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  document = cl_document_bcs=&amp;gt;create_document(
                      i_type    = 'RAW'
                      i_text    = lt_text
                      i_subject = subject ).

* add sender
* add recipient

* read the documents I want to send

LOOP AT lt_list_files INTO ls_list_files.
	

             CALL METHOD document-&amp;gt;add_attachment
                  EXPORTING
                    i_attachment_type     = 'DOC'
                    i_attachment_subject  = file_name
                    I_ATT_CONTENT_HEX     = lt_content_hex.

ENDLOOP.

* add our document (and its attachments) to send request.
      CALL METHOD send_request-&amp;gt;set_document( document ).

* set send immediately flag
       send_request-&amp;gt;set_send_immediately( 'X' ).

* Send document
       call method send_request-&amp;gt;send( ).

    COMMIT WORK.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that if I send attachments lt_text becomes an attachment too (!?!) and I want it to be the E-Mail Body. Without attachments lt_text is sent as expected as an E-Mail Body.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why&amp;#146;s that ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mihai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jan 2005 14:07:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-bcs-classes-to-send-emails-with-attachments/m-p/846381#M45305</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-24T14:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using BCS classes to send emails with attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-bcs-classes-to-send-emails-with-attachments/m-p/846382#M45306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mihai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if this is what you are looking for, but there seems to be a SAP Note 489848, which you might want to refer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have not already done so, you can try experimenting with the methods CREATE_FROM_TEXT and ADD_DOCUMENT_AS_ATTACHMENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jan 2005 14:22:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-bcs-classes-to-send-emails-with-attachments/m-p/846382#M45306</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-24T14:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using BCS classes to send emails with attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-bcs-classes-to-send-emails-with-attachments/m-p/846383#M45307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you !&lt;/P&gt;&lt;P&gt;This is the solution (edited from 'This seems to be the answer'.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also discovered (&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="12963"&gt;&lt;/A&gt;) the function SO_DOCUMENT_SEND_API1 that enables one to specify the sender as well. I knew only SO_NEW_DOCUMENT_ATT_SEND_API1 but the problem was that in the sent email &amp;#145;From&amp;#146; shows the email of the user &amp;lt;name@company.com&amp;gt; who executed the program that called this function and I needed in &amp;#145;From&amp;#146; to be a generic email address something like contact@company.com.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because of that I tried to use BCS classes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Mihai Olaru&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jan 2005 09:00:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-bcs-classes-to-send-emails-with-attachments/m-p/846383#M45307</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-01-25T09:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using BCS classes to send emails with attachments</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-bcs-classes-to-send-emails-with-attachments/m-p/846384#M45308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have s special question concerning the BCS class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to attach a SAP-Object ?&lt;/P&gt;&lt;P&gt;Example purchase order&lt;/P&gt;&lt;P&gt; obj bus2012&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;What method of cl_document_bcs can be used?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I have to create any kind of persistence before&lt;/P&gt;&lt;P&gt;calling a mehod?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Dec 2005 20:25:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-bcs-classes-to-send-emails-with-attachments/m-p/846384#M45308</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-19T20:25:33Z</dc:date>
    </item>
  </channel>
</rss>

