<?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: Not able to send mail using SO_OBJECT_SEND. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576420#M1565919</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are many posts for this function module. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also have you checked on your own SAP system to see if this FM is used by another other programs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Jan 2011 11:48:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-01-04T11:48:48Z</dc:date>
    <item>
      <title>Not able to send mail using SO_OBJECT_SEND.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576416#M1565915</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'm trying to send a Mail using FM &lt;STRONG&gt;SO_OBJECT_SEND&lt;/STRONG&gt;, the coding for which is attached below, here the problem is even if &lt;STRONG&gt;SY-SUBRC is 0&lt;/STRONG&gt; mail is not sent, I've checked the same in SCOT and SOST, but there are no mails in the outbox.&lt;/P&gt;&lt;P&gt;I've tried it using COMMIT WORK as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF lv_email IS NOT INITIAL.
*RECEIVERS table
    CLEAR wa_reclist.
    REFRESH lt_reclist.
    wa_reclist-recextnam = lv_email.   " Email Address
    wa_reclist-recesc     = 'A'.       " Receiver type
    wa_reclist-sndart     = 'MAIL'.
    wa_reclist-sndpri     = '1'.
    wa_reclist-mailstatus = 'X'.
    wa_reclist-rcdat      = sy-datum.
    wa_reclist-rctim      = sy-uzeit.
    wa_reclist-deliver    = 'X'.
    wa_reclist-not_deli   = 'X'.
    wa_reclist-sndex      = 'X'.       " EXPRESS DOCUMENT
    APPEND wa_reclist TO lt_reclist.
  ENDIF.

**BUILD MESSAGE HEADER
* General data
  wa_objhd-objla = sy-langu.
  wa_objhd-objnam = 'Sales Order Created.'.

* Message Body
  CLEAR wa_objcont.
  CONCATENATE 'Sales Order:- ' vbeln 'created.' INTO wa_objcont-line.
  APPEND wa_objcont TO lt_objcont.

  CALL FUNCTION 'SO_OBJECT_SEND'
    EXPORTING
      object_hd_change           = wa_objhd
      object_type                = 'RAW'
      outbox_flag                = 'X'
    TABLES
      objcont                    = lt_objcont
      receivers                  = lt_reclist
    EXCEPTIONS
      active_user_not_exist      = 1
      communication_failure      = 2
      component_not_available    = 3
      folder_not_exist           = 4
      folder_no_authorization    = 5
      forwarder_not_exist        = 6
      note_not_exist             = 7
      object_not_exist           = 8
      object_not_sent            = 9
      object_no_authorization    = 10
      object_type_not_exist      = 11
      operation_no_authorization = 12
      owner_not_exist            = 13
      parameter_error            = 14
      substitute_not_active      = 15
      substitute_not_defined     = 16
      system_failure             = 17
      too_much_receivers         = 18
      user_not_exist             = 19
      x_error                    = 20
      OTHERS                     = 21.

  COMMIT WORK.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 11:08:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576416#M1565915</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-04T11:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to send mail using SO_OBJECT_SEND.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576417#M1565916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;&amp;lt;Do NOT copy-paste code from elsewhere&amp;gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;&amp;lt;Do NOT Demand points&amp;gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kishan P on Jan 4, 2011 4:52 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 11:11:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576417#M1565916</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-04T11:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to send mail using SO_OBJECT_SEND.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576418#M1565917</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;Try with the below FM's&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          document_data  = wa_docdata&lt;/P&gt;&lt;P&gt;          document_type  = 'HTM'&lt;/P&gt;&lt;P&gt;          put_in_outbox  = 'X'&lt;/P&gt;&lt;P&gt;          commit_work    = 'X'&lt;/P&gt;&lt;P&gt;        TABLES&lt;/P&gt;&lt;P&gt;          object_content = i_content&lt;/P&gt;&lt;P&gt;          receivers      = i_receiver.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creates persistent send request&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    l_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;Craete document for mail body&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    l_document = cl_document_bcs=&amp;gt;create_document(&lt;/P&gt;&lt;P&gt;                 i_type    = 'HTM'&lt;/P&gt;&lt;P&gt;                 i_text    = i_content"l_body  " Mail body&lt;/P&gt;&lt;P&gt;                 i_subject = l_subject ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD l_send_request-&amp;gt;set_document( l_document ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sender addess&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    l_sender = cl_sapuser_bcs=&amp;gt;create( 'ABC' ).&lt;/P&gt;&lt;P&gt;    CALL METHOD l_send_request-&amp;gt;set_sender&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        i_sender = l_sender.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Recipient address&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF wa_result-email IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;      l_email = wa_result-email.&lt;/P&gt;&lt;P&gt;      l_recipient = cl_cam_address_bcs=&amp;gt;create_internet_address( l_email ).&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add recipient address to send request&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CALL METHOD l_send_request-&amp;gt;add_recipient&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          i_recipient  = l_recipient&lt;/P&gt;&lt;P&gt;          i_express    = 'X'&lt;/P&gt;&lt;P&gt;          i_copy       = ' '&lt;/P&gt;&lt;P&gt;          i_blind_copy = ' '&lt;/P&gt;&lt;P&gt;          i_no_forward = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      status_mail = requested_status.&lt;/P&gt;&lt;P&gt;      CALL METHOD l_send_request-&amp;gt;set_status_attributes&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          i_requested_status = requested_status&lt;/P&gt;&lt;P&gt;          i_status_mail      = status_mail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Trigger E-Mail immediately&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      l_send_request-&amp;gt;set_send_immediately( 'X' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Send mail&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CALL METHOD l_send_request-&amp;gt;send( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      COMMIT WORK.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 11:18:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576418#M1565917</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-04T11:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to send mail using SO_OBJECT_SEND.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576419#M1565918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kishore,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know using the FM &lt;STRONG&gt;SO_NEW_DOCUMENT_SEND_API1&lt;/STRONG&gt; mightl work, but for that i need to do lot of changes plus i dont want to send an attachment, I just want to send a plain mail with one line in the Body.&lt;/P&gt;&lt;P&gt;I would appreciate if you can help me with &lt;STRONG&gt;SO_OBJECT_SEND&lt;/STRONG&gt; FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your Reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 11:43:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576419#M1565918</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-04T11:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to send mail using SO_OBJECT_SEND.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576420#M1565919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are many posts for this function module. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also have you checked on your own SAP system to see if this FM is used by another other programs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 11:48:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576420#M1565919</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-04T11:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to send mail using SO_OBJECT_SEND.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576421#M1565920</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've tried this code and it seems to work fine (I can see my message in SOST):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: LT_OBJCONT TYPE TABLE OF SOLI.
DATA: WA_OBJCONT TYPE SOLI.
DATA: LT_RECLIST TYPE TABLE OF SOOS1.
DATA: WA_RECLIST TYPE SOOS1.
DATA: WA_OBJHD   TYPE SOOD1.
DATA: LT_OBJHEAD TYPE TABLE OF SOLI WITH HEADER LINE.

*RECEIVERS table
CLEAR WA_RECLIST.
REFRESH LT_RECLIST.
WA_RECLIST-RECEXTNAM = &amp;lt;mail address&amp;gt;'.   " Email Address
WA_RECLIST-RECESC     = 'U'.       " Receiver type
*WA_RECLIST-SNDART     = 'MAIL'.
*WA_RECLIST-SNDPRI     = '1'.
*WA_RECLIST-MAILSTATUS = 'X'.
WA_RECLIST-RCDAT      = SY-DATUM.
WA_RECLIST-RCTIM      = SY-UZEIT.
WA_RECLIST-DELIVER    = 'X'.
WA_RECLIST-NOT_DELI   = 'X'.
WA_RECLIST-SNDEX      = 'X'.       " EXPRESS DOCUMENT
APPEND WA_RECLIST TO LT_RECLIST.

**BUILD MESSAGE HEADER
* General data
WA_OBJHD-OBJLA = SY-LANGU.
WA_OBJHD-OBJDES = 'Sales Order Created.'.

* Message Body
CLEAR WA_OBJCONT.
CONCATENATE 'Sales Order:- ' '100' 'created.' INTO WA_OBJCONT-LINE.
APPEND WA_OBJCONT TO LT_OBJCONT.



CALL FUNCTION 'SO_OBJECT_SEND'
  EXPORTING
    OBJECT_HD_CHANGE           = WA_OBJHD
    OBJECT_TYPE                = 'RAW'
    OUTBOX_FLAG                = 'X'
  TABLES
    OBJCONT                    = LT_OBJCONT
    RECEIVERS                  = LT_RECLIST
  EXCEPTIONS
    ACTIVE_USER_NOT_EXIST      = 1
    COMMUNICATION_FAILURE      = 2
    COMPONENT_NOT_AVAILABLE    = 3
    FOLDER_NOT_EXIST           = 4
    FOLDER_NO_AUTHORIZATION    = 5
    FORWARDER_NOT_EXIST        = 6
    NOTE_NOT_EXIST             = 7
    OBJECT_NOT_EXIST           = 8
    OBJECT_NOT_SENT            = 9
    OBJECT_NO_AUTHORIZATION    = 10
    OBJECT_TYPE_NOT_EXIST      = 11
    OPERATION_NO_AUTHORIZATION = 12
    OWNER_NOT_EXIST            = 13
    PARAMETER_ERROR            = 14
    SUBSTITUTE_NOT_ACTIVE      = 15
    SUBSTITUTE_NOT_DEFINED     = 16
    SYSTEM_FAILURE             = 17
    TOO_MUCH_RECEIVERS         = 18
    USER_NOT_EXIST             = 19
    X_ERROR                    = 20
    OTHERS                     = 21.

WRITE: SY-SUBRC.

COMMIT WORK.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've changed, the receiver type:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;WA_RECLIST-RECESC     = 'U'.       " Receiver type&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's U instead of A &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The descripition (for the mail subject):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;WA_OBJHD-OBJDES = 'Sales Order Created.'.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't send the mail because in my dev sustem is not active&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 12:15:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576421#M1565920</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-04T12:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to send mail using SO_OBJECT_SEND.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576422#M1565921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried it with all the rec type combinations, but the same problem persists in my system i.e i cannot test it on Dev and moved it to Qua by keeping the rec type as 'A' and without COMMIT WORK.&lt;/P&gt;&lt;P&gt;After which I've done two changes:-&lt;/P&gt;&lt;P&gt;1. Added COMMIT WORK.&lt;/P&gt;&lt;P&gt;2. Changed the rec type to 'U'.&lt;/P&gt;&lt;P&gt;but still not worked, coz i tested the same in Dev, your reply encouraged me and i moved it to Qua and tested, and now it works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also i added 1 more statement:-&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SUBMIT rsconn01 WITH mode = 'INT'
       AND RETURN.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;which sends the mail immediately, i.e. no need to wait for the background job to send the mail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Sunil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 14:19:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576422#M1565921</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-04T14:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to send mail using SO_OBJECT_SEND.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576423#M1565922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually running the below code will send all emails that are waiting to be processed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUBMIT rsconn01 WITH mode = 'INT'&lt;/P&gt;&lt;P&gt;       AND RETURN.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 14:36:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/not-able-to-send-mail-using-so-object-send/m-p/7576423#M1565922</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-04T14:36:28Z</dc:date>
    </item>
  </channel>
</rss>

