<?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: getting message as attachment!! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874137#M674475</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hymavathi..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You had mistaken the requirement..the content of my mail ie. message part in the mail is going / coming as attachment. The pdf format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont want attachment in my mail sending and receiving....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;am able to execute successfully in one network..like it is going as a message.. ie body part of mail.. in other network the content goes as a attached format..... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hence in the other network.. what settings needs to be done.. inoder to avoid the attachment format and send it as a normal message...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls go ahead...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Sep 2007 11:29:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-27T11:29:03Z</dc:date>
    <item>
      <title>getting message as attachment!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874129#M674467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an ABAP program where i could send mails to the recipients.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the recipients are able to receive the content of the mails only in attached pdf format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But could not get as a body content in the email.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had passed packing_list-Document type = 'RAW' in in so_document_send_API1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What should i need to do in the settings..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will be awarded.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in adv!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 09:54:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874129#M674467</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T09:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: getting message as attachment!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874130#M674468</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;Refer to the below code. It works fine to send emails with text body as well as attachments.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: If this solves your question pl mark it answered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_______________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT zmfv_rough_pad.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA :&lt;/P&gt;&lt;P&gt;li_attachment TYPE TABLE OF soli, " hold attachment contents&lt;/P&gt;&lt;P&gt;li_pdf TYPE TABLE OF tline, " hold data from spool in PDF format&lt;/P&gt;&lt;P&gt;li_objpack TYPE TABLE OF sopcklsti1, " hold email body, attachment details&lt;/P&gt;&lt;P&gt;li_objtxt TYPE TABLE OF solisti1, " hold message contents&lt;/P&gt;&lt;P&gt;li_reclist TYPE TABLE OF somlreci1. " hold email reciever details&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA :&lt;/P&gt;&lt;P&gt;lwa_attachment LIKE LINE OF li_attachment,&lt;/P&gt;&lt;P&gt;lwa_pdf LIKE LINE OF li_pdf,&lt;/P&gt;&lt;P&gt;lwa_objpack LIKE LINE OF li_objpack,&lt;/P&gt;&lt;P&gt;lwa_objtxt LIKE LINE OF li_objtxt,&lt;/P&gt;&lt;P&gt;lwa_reclist LIKE LINE OF li_reclist,&lt;/P&gt;&lt;P&gt;lwa_document_data TYPE sodocchgi1. " hold document details like title, size etc.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;DATA :&lt;/P&gt;&lt;P&gt;lv_sent_to_all TYPE c, " flag to check if mail is sent to all&lt;/P&gt;&lt;P&gt;l_att_lines TYPE i, " hold number of lines in attachment table&lt;/P&gt;&lt;P&gt;lv_spool_desc(68) TYPE c. " hold description of spool&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;CONSTANTS : lc_email_txt TYPE solisti1-line VALUE 'Find attached Payment Advice sent by this email.',&lt;/P&gt;&lt;P&gt;lc_sensitivity TYPE sodocchgi1-sensitivty VALUE 'O',&lt;/P&gt;&lt;P&gt;lc_raw TYPE sopcklsti1-doc_type VALUE 'RAW',&lt;/P&gt;&lt;P&gt;lc_pdf TYPE sopcklsti1-doc_type VALUE 'PDF',&lt;/P&gt;&lt;P&gt;lc_transf_bin TYPE sopcklsti1-transf_bin VALUE 'X',&lt;/P&gt;&lt;P&gt;lc_email TYPE sopcklsti1-obj_name VALUE 'Email',&lt;/P&gt;&lt;P&gt;lc_ext_id TYPE somlreci1-rec_type VALUE 'U',&lt;/P&gt;&lt;P&gt;lc_outbox TYPE sonv-flag VALUE 'X',&lt;/P&gt;&lt;P&gt;lc_obj_name TYPE sodocchgi1-obj_name VALUE 'Email Test',&lt;/P&gt;&lt;P&gt;lc_1 TYPE n VALUE '1',&lt;/P&gt;&lt;P&gt;lc_0 TYPE n VALUE '0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;CLEAR: lwa_attachment,&lt;/P&gt;&lt;P&gt;lwa_pdf,&lt;/P&gt;&lt;P&gt;lwa_reclist,&lt;/P&gt;&lt;P&gt;lwa_objtxt,&lt;/P&gt;&lt;P&gt;lwa_objpack,&lt;/P&gt;&lt;P&gt;lwa_document_data.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;REFRESH : li_attachment,&lt;/P&gt;&lt;P&gt;li_pdf,&lt;/P&gt;&lt;P&gt;li_reclist,&lt;/P&gt;&lt;P&gt;li_objtxt,&lt;/P&gt;&lt;P&gt;li_objpack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Build attachment table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;lwa_attachment-line = 'YOUR TEXT FROM INTERNAL TABLE LINES'.&lt;/P&gt;&lt;P&gt;APPEND lwa_attachment TO li_attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Body of email&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLEAR lwa_objtxt.&lt;/P&gt;&lt;P&gt;MOVE lc_email_txt TO lwa_objtxt.&lt;/P&gt;&lt;P&gt;APPEND lwa_objtxt TO li_objtxt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Title of the email&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;lwa_document_data-obj_descr = 'Title of email'.&lt;/P&gt;&lt;P&gt;lwa_document_data-sensitivty = lc_sensitivity.&lt;/P&gt;&lt;P&gt;lwa_document_data-expiry_dat = sy-datum + 15.&lt;/P&gt;&lt;P&gt;lwa_document_data-doc_size = STRLEN( lwa_objtxt ).&lt;/P&gt;&lt;P&gt;lwa_document_data-obj_name = lc_obj_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;e-mail body&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLEAR lwa_objpack.&lt;/P&gt;&lt;P&gt;lwa_objpack-head_start = lc_1.&lt;/P&gt;&lt;P&gt;lwa_objpack-head_num = lc_0.&lt;/P&gt;&lt;P&gt;lwa_objpack-body_start = lc_1.&lt;/P&gt;&lt;P&gt;lwa_objpack-body_num = lc_1.&lt;/P&gt;&lt;P&gt;lwa_objpack-doc_type = lc_raw.&lt;/P&gt;&lt;P&gt;lwa_objpack-doc_size = STRLEN( lwa_objtxt ).&lt;/P&gt;&lt;P&gt;APPEND lwa_objpack TO li_objpack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;For e-mail attachment&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DESCRIBE TABLE li_attachment LINES l_att_lines.&lt;/P&gt;&lt;P&gt;CLEAR lwa_attachment.&lt;/P&gt;&lt;P&gt;READ TABLE li_attachment INDEX l_att_lines INTO lwa_attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR lwa_objpack.&lt;/P&gt;&lt;P&gt;lwa_objpack-transf_bin = lc_transf_bin.&lt;/P&gt;&lt;P&gt;lwa_objpack-head_start = lc_1.&lt;/P&gt;&lt;P&gt;lwa_objpack-head_num = lc_1.&lt;/P&gt;&lt;P&gt;lwa_objpack-body_start = lc_1.&lt;/P&gt;&lt;P&gt;lwa_objpack-body_num = l_att_lines.&lt;/P&gt;&lt;P&gt;lwa_objpack-doc_type = lc_raw.&lt;/P&gt;&lt;P&gt;lwa_objpack-obj_name = lc_email.&lt;/P&gt;&lt;P&gt;lwa_objpack-obj_descr = lv_spool_desc.&lt;/P&gt;&lt;P&gt;lwa_objpack-doc_size = ( 255 * ( l_att_lines - 1 ) ) + STRLEN( lwa_attachment-line ).&lt;/P&gt;&lt;P&gt;APPEND lwa_objpack TO li_objpack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;make recipient list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLEAR lwa_reclist.&lt;/P&gt;&lt;P&gt;lwa_reclist-receiver = 'ABC@XYZ.com'. " Email address of your receipient&lt;/P&gt;&lt;P&gt;lwa_reclist-rec_type = lc_ext_id. " To external email id&lt;/P&gt;&lt;P&gt;lwa_reclist-COM_TYPE = 'INT'. " Internet mail&lt;/P&gt;&lt;P&gt;APPEND lwa_reclist TO li_reclist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;send mail with attachment&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;document_data = lwa_document_data&lt;/P&gt;&lt;P&gt;put_in_outbox = lc_outbox&lt;/P&gt;&lt;P&gt;commit_work = 'X'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;sent_to_all = lv_sent_to_all&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;packing_list = li_objpack&lt;/P&gt;&lt;P&gt;contents_bin = li_attachment&lt;/P&gt;&lt;P&gt;contents_txt = li_objtxt&lt;/P&gt;&lt;P&gt;receivers = li_reclist&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;too_many_receivers = 1&lt;/P&gt;&lt;P&gt;document_not_sent = 2&lt;/P&gt;&lt;P&gt;document_type_not_exist = 3&lt;/P&gt;&lt;P&gt;operation_no_authorization = 4&lt;/P&gt;&lt;P&gt;parameter_error = 5&lt;/P&gt;&lt;P&gt;x_error = 6&lt;/P&gt;&lt;P&gt;enqueue_error = 7&lt;/P&gt;&lt;P&gt;OTHERS = 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: 'Success'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 09:59:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874130#M674468</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T09:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: getting message as attachment!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874131#M674469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer this program&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 09:59:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874131#M674469</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T09:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: getting message as attachment!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874132#M674470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Look at the below links&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;sending external email&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/email/email_mbody.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/email/email_mbody.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Sending mail with attachment&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/sending-email-with-attachment.htm" target="test_blank"&gt;http://www.sap-img.com/abap/sending-email-with-attachment.htm&lt;/A&gt;&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; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2007 10:04:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874132#M674470</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-24T10:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: getting message as attachment!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874133#M674471</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;Our problem is not in the coding level &lt;/P&gt;&lt;P&gt;If we run the program through our network the contents are displaying in pdf attachment,but if the same pgm is executed from the other network the itab contents are displayed as the plain text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 12:50:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874133#M674471</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T12:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: getting message as attachment!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874134#M674472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes.. that's right... our problem is not with the coding level...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2007 15:04:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874134#M674472</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-25T15:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: getting message as attachment!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874135#M674473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check your configuration is the transaction SCOT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2007 07:23:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874135#M674473</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-27T07:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: getting message as attachment!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874136#M674474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;REPORT ztest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;This example shows how to send&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  - a simple text provided in an internal table of text lines&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  - and an attached MS word document provided in internal table&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  - to some internet email address.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;All activities done via facade CL_BCS!&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: send_request       TYPE REF TO cl_bcs.&lt;/P&gt;&lt;P&gt;DATA: text               TYPE bcsy_text.&lt;/P&gt;&lt;P&gt;DATA: text_xls               TYPE bcsy_text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*data: binary_content     type solix_tab.&lt;/P&gt;&lt;P&gt;DATA: document           TYPE REF TO cl_document_bcs.&lt;/P&gt;&lt;P&gt;DATA: sender             TYPE REF TO cl_sapuser_bcs.&lt;/P&gt;&lt;P&gt;DATA: recipient          TYPE REF TO if_recipient_bcs.&lt;/P&gt;&lt;P&gt;DATA: bcs_exception      type ref to cx_bcs.&lt;/P&gt;&lt;P&gt;data: sent_to_all        type os_boolean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    PERFORM main.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      FORM main                                                     *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM main.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  try.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    -------- create persistent send request ------------------------&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      send_request = cl_bcs=&amp;gt;create_persistent( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     TRY.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CATCH CX_SEND_REQ_BCS .&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     ENDTRY.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    -------- create and set document with attachment ---------------&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    create document from internal table with text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      APPEND 'Hi! how r u ? open the xls.' TO text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      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    = text&lt;/P&gt;&lt;P&gt;                      i_length  = '12'&lt;/P&gt;&lt;P&gt;                      i_subject = 'test created by BCS_EXAMPLE_2' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    add attachment to document&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    BCS expects document content here e.g. from document upload&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*TRY.&lt;/P&gt;&lt;P&gt;append 'HI' to text_xls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD DOCUMENT-&amp;gt;ADD_ATTACHMENT&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    I_ATTACHMENT_TYPE     = 'DOC'&lt;/P&gt;&lt;P&gt;    I_ATTACHMENT_SUBJECT  = 'My attachment'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   I_ATTACHMENT_SIZE     =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   I_ATTACHMENT_LANGUAGE = SPACE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  &amp;lt;b&amp;gt;  I_ATT_CONTENT_TEXT    = text&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   I_ATT_CONTENT_HEX     =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   I_ATTACHMENT_HEADER   =.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    .&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CATCH CX_DOCUMENT_BCS .&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     CALL METHOD document-&amp;gt;add_attachment&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       EXPORTING  i_attachment_type = 'XLS'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                  i_attachment_subject = 'My Attachment'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                  i_att_content_hex    = binary_content.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    add document to send request&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CALL METHOD send_request-&amp;gt;set_document( document ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    --------- set sender -------------------------------------------&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    note: this is necessary only if you want to set the sender&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          different from actual user (SY-UNAME). Otherwise sender is&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          set automatically with actual user.&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;      CALL METHOD send_request-&amp;gt;set_sender&lt;/P&gt;&lt;P&gt;        EXPORTING i_sender = sender.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    --------- add recipient (e-mail address) -----------------------&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    create recipient - please replace e-mail address !!!&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      recipient = cl_cam_address_bcs=&amp;gt;create_internet_address(&lt;/P&gt;&lt;P&gt;                                        'hymavathi.oruganti@hp.com' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    add recipient with its respective attributes to send request&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CALL METHOD send_request-&amp;gt;add_recipient&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          i_recipient  = recipient&lt;/P&gt;&lt;P&gt;          i_express    = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    ---------- send document ---------------------------------------&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CALL METHOD send_request-&amp;gt;send(&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;          i_with_error_screen = 'X'&lt;/P&gt;&lt;P&gt;        receiving&lt;/P&gt;&lt;P&gt;          result              = sent_to_all ).&lt;/P&gt;&lt;P&gt;      if sent_to_all = 'X'.&lt;/P&gt;&lt;P&gt;        write text-003.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;-----------------------------------------------------------&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;*                     exception handling&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;-----------------------------------------------------------&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;* replace this very rudimentary exception handling&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;* with your own one !!!&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;-----------------------------------------------------------&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  catch cx_bcs into bcs_exception.&lt;/P&gt;&lt;P&gt;    write: 'Fehler aufgetreten.'(001).&lt;/P&gt;&lt;P&gt;    write: 'Fehlertyp:'(002), bcs_exception-&amp;gt;error_type.&lt;/P&gt;&lt;P&gt;    exit.&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;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEE THE ABOVE EXAMPLE, what i bolded is for getting the content&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2007 07:27:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874136#M674474</guid>
      <dc:creator>hymavathi_oruganti</dc:creator>
      <dc:date>2007-09-27T07:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: getting message as attachment!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874137#M674475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hymavathi..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You had mistaken the requirement..the content of my mail ie. message part in the mail is going / coming as attachment. The pdf format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont want attachment in my mail sending and receiving....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;am able to execute successfully in one network..like it is going as a message.. ie body part of mail.. in other network the content goes as a attached format..... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hence in the other network.. what settings needs to be done.. inoder to avoid the attachment format and send it as a normal message...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls go ahead...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2007 11:29:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-message-as-attachment/m-p/2874137#M674475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-27T11:29:03Z</dc:date>
    </item>
  </channel>
</rss>

