<?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: sending mial using SO_NEW_DOCUMENT_SEND_API1 :getting error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096499#M1182819</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi kalyan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this blog&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Feb 2009 10:00:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-06T10:00:43Z</dc:date>
    <item>
      <title>sending mial using SO_NEW_DOCUMENT_SEND_API1 :getting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096493#M1182813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Experts ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz help me  i am taking sample program in this FM but unable to send mial .&lt;/P&gt;&lt;P&gt;my mial id needs any configuration is needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 09:46:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096493#M1182813</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T09:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: sending mial using SO_NEW_DOCUMENT_SEND_API1 :getting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096494#M1182814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Scott settings need to be maintained for this. Basis guys will take care of this. get in touch with them&lt;/P&gt;&lt;P&gt;Also in debugging mode check the sy-subrc value of after the FMs execution.&lt;/P&gt;&lt;P&gt;If sy-subrc is 0 then check your SAP outbox. If the mail is present there then&lt;/P&gt;&lt;P&gt;again basis has the responsibility to send it from there to your mailid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rudra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 09:50:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096494#M1182814</guid>
      <dc:creator>former_member195383</dc:creator>
      <dc:date>2009-02-06T09:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: sending mial using SO_NEW_DOCUMENT_SEND_API1 :getting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096495#M1182815</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;Check this Code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: l_tab_lines TYPE i,
        l_string TYPE char300,
        l_line TYPE string.

  CONSTANTS : l_c_255(255)  TYPE c VALUE '255',
              l_c_txt(3)    TYPE c VALUE 'TXT'.

  DATA: lt_reclist  TYPE STANDARD TABLE OF somlreci1,       "Recipients
        lt_objpack  TYPE STANDARD TABLE OF sopcklsti1,
        lt_objhead  TYPE STANDARD TABLE OF solisti1,
        lt_objtxt   TYPE STANDARD TABLE OF solisti1,     "Body of EMail
        lt_objbin   TYPE STANDARD TABLE OF solisti1."Attachment of EMail

  DATA: l_doc_chng TYPE sodocchgi1,     "attributes of document to send
        l_reclist  LIKE LINE OF lt_reclist,
        l_objpack  LIKE LINE OF lt_objpack,
        l_obj      LIKE LINE OF lt_objhead.

  DATA :
    l_hex LIKE solix,
    lt_contents_hex LIKE STANDARD TABLE OF solix ,
    conv TYPE REF TO cl_abap_conv_out_ce,
    l_buffer TYPE xstring,
    l_hexa(510) TYPE x.

* Completing the recipient list
  l_reclist-receiver = p_emailid.           " Email id
  l_reclist-express  = 'X'.
  l_reclist-rec_type = 'U'.
  APPEND l_reclist TO lt_reclist.
  CLEAR  l_reclist.


* Body of Email Message
  APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line
  l_obj-line = 'Hello,'(012).
  APPEND l_obj TO lt_objtxt.   CLEAR l_obj.

  l_obj-line = cl_abap_char_utilities=&amp;gt;newline.
  APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line

  CONCATENATE
   'Please click the link to acess the Confirmation Form.'(t01)
   'Kindly complete the same and return it to the HR contact 15 days' &amp;amp;
   ' prior to the date of confirmation of the employee.'(t02)
               INTO l_obj-line SEPARATED BY space.
  APPEND l_obj TO lt_objtxt.   CLEAR l_obj.

  l_obj-line = cl_abap_char_utilities=&amp;gt;newline.
  APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line

  CONCATENATE text-l01 text-l02 INTO l_obj-line.
  APPEND l_obj TO lt_objtxt.   CLEAR l_obj.

  l_obj-line = cl_abap_char_utilities=&amp;gt;newline.
  APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line

  l_obj-line =
  'For Trainees use Confirmation form trainees and for rest use the' &amp;amp;
  ' Confirmation form.'(t03).
  APPEND l_obj TO lt_objtxt.
  CLEAR l_obj.


  l_obj-line = cl_abap_char_utilities=&amp;gt;newline.
  APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line

  l_obj-line = 'The details of the employee are as follows :'(017).
  APPEND l_obj TO lt_objtxt.   CLEAR l_obj.

  l_obj-line = cl_abap_char_utilities=&amp;gt;newline.
  APPEND l_obj TO lt_objtxt.   CLEAR l_obj.       " Blank line


  l_obj-line = 'Name'(013).
  l_obj-line+60 = 'Department'(005).
  l_obj-line+128 = 'DOJ'(014).
  l_obj-line+150 = 'Confirmation Date'(015).
*  CONCATENATE 'Name'(013)
*              'Department'(005)
*              'DOJ'(014)
*              'Confirmation Date'(015)
*            INTO l_obj-line
*       SEPARATED BY cl_abap_char_utilities=&amp;gt;horizontal_tab.
  APPEND l_obj TO lt_objtxt.   CLEAR l_obj.

* Email Attachment
* Append headings
  CONCATENATE 'Empployee No.'(002)
              'Employee Group'(016)
              'Employee Name'(001)
              'Designation'(003)
              'Joining Date'(004)
              'Department'(005)
              'Branch/Location'(006)
              'Unit'(007)
              'Confirmation Due'(008)
              'Form sent on'(009)
              'Form Return by'(010)
              'Employee Group'(016)
            INTO l_string
       SEPARATED BY cl_abap_char_utilities=&amp;gt;horizontal_tab.
  APPEND l_string TO lt_objbin.
  CLEAR l_string.

  APPEND INITIAL LINE TO lt_objbin.

  LOOP AT p_emp_details INTO i_emp_details_line.
    CONCATENATE i_emp_details_line-pnalt
                i_emp_details_line-egroup
                i_emp_details_line-ename
                i_emp_details_line-stext
                i_emp_details_line-srvdt
                i_emp_details_line-ltext
                i_emp_details_line-pbtxt
                i_emp_details_line-btrtx
                i_emp_details_line-mndat
                i_emp_details_line-fsdate
                i_emp_details_line-frdate
                i_emp_details_line-egroup
           INTO l_string
      SEPARATED BY cl_abap_char_utilities=&amp;gt;horizontal_tab.
*    CONCATENATE l_string cl_abap_char_utilities=&amp;gt;horizontal_tab
*               INTO l_string.
    APPEND l_string TO lt_objbin.
    CLEAR l_string.

    l_obj-line = i_emp_details_line-ename.
    l_obj-line+60 = i_emp_details_line-ltext.
    l_obj-line+128 = i_emp_details_line-srvdt.
    l_obj-line+150 = i_emp_details_line-mndat.

*    CONCATENATE i_emp_details_line-ename
*                i_emp_details_line-ltext
*                i_emp_details_line-srvdt
*                i_emp_details_line-mndat
*            INTO l_obj-line
*       SEPARATED BY cl_abap_char_utilities=&amp;gt;horizontal_tab.
    APPEND l_obj TO lt_objtxt.   CLEAR l_obj.


  ENDLOOP.

  IF r_cprob EQ 'X'.
    l_string = 'Completion of probation List'(029).
  ELSE.
    l_string = 'Completion of extension of probation List'(018).
  ENDIF.
  APPEND l_string TO lt_objhead.

* APPEND object_header.
  CALL FUNCTION 'SO_RAW_TO_RTF'
    TABLES
      objcont_old = lt_objbin
      objcont_new = lt_objbin.

  LOOP AT lt_objbin INTO l_line.
   conv = cl_abap_conv_out_ce=&amp;gt;create( encoding = 'UTF-8' endian = 'B').
    CALL METHOD conv-&amp;gt;write( data = l_line ).
    l_buffer = conv-&amp;gt;get_buffer( ).
    MOVE l_buffer TO l_hexa.
    MOVE l_hexa TO l_hex-line.
    APPEND l_hex TO lt_contents_hex.
  ENDLOOP.

* File name for attachment
  CONCATENATE 'Completion of extension of probation List'(018)
               sy-datum '.XLS' INTO l_obj SEPARATED BY space.
  APPEND l_obj TO lt_objhead.

* Email Body Details
  CLEAR l_tab_lines.
  DESCRIBE TABLE lt_objtxt LINES l_tab_lines.
  l_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 +
                          STRLEN( l_string ).  "size of doc in bytes
  l_doc_chng-obj_name = sy-repid.
  l_doc_chng-obj_langu = sy-langu.
  l_doc_chng-obj_descr = 'Completion of extension of probation'(s05).
  l_doc_chng-sensitivty = 'P'.          "  Send mail as a confidential

  l_objpack-head_start = 1.
  l_objpack-head_num   = 1.
  l_objpack-body_start = 1.
  l_objpack-body_num   = l_tab_lines.
  l_objpack-doc_type   = l_c_txt.
  APPEND l_objpack TO lt_objpack.
  CLEAR  l_objpack.

* Email Attachment Details
  CLEAR l_tab_lines.
  DESCRIBE TABLE lt_objbin LINES l_tab_lines.
* Creation of the entry for the compressed attachment
  l_objpack-transf_bin = 'X'.
  l_objpack-head_start = 1.
  l_objpack-head_num   = 1.
  l_objpack-body_start = 1.
  l_objpack-doc_type   = 'XLS'.
  l_objpack-obj_name   = l_obj.
  l_objpack-obj_descr  = l_obj.
  l_objpack-body_num   = l_tab_lines.
  l_objpack-doc_size   = l_tab_lines * l_c_255.
  APPEND l_objpack TO lt_objpack.
  CLEAR  l_objpack.

* Send the document
  CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
    EXPORTING
      document_data              = l_doc_chng
      put_in_outbox              = ' '
      commit_work                = 'X'
    TABLES
      packing_list               = lt_objpack
      object_header              = lt_objhead
*      contents_bin               = lt_objbin
      contents_txt               = lt_objtxt
      contents_hex               = lt_contents_hex
      receivers                  = lt_reclist
    EXCEPTIONS
      too_many_receivers         = 1
      document_not_sent          = 2
      document_type_not_exist    = 3
      operation_no_authorization = 4
      parameter_error            = 5
      x_error                    = 6
      enqueue_error              = 7
      OTHERS                     = 8.

  IF sy-subrc = 0.
    MESSAGE s000(oo) WITH 'Email sent to recipients'(019).
*   To refresh SAP Work Office so that mail can be recieved immediataly.
    SUBMIT rsconn01 WITH mode = 'INT'
                  WITH output = ''
                  AND RETURN.

*   Update the infotype 0019 after sending the email with the status
*   u2018Task in processu2018 from u2018Task in processu2018.
    PERFORM update_0019 TABLES p_emp_details.

  ELSE.
    MESSAGE s000(oo) WITH 'Problem in sending Email.'(e01).
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 09:51:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096495#M1182815</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T09:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: sending mial using SO_NEW_DOCUMENT_SEND_API1 :getting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096496#M1182816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Prasanna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;scott settings are mandatory to send a mail to outside ? and we are getting sy-subrc = 2 . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that means document not send to any recepient.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 09:53:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096496#M1182816</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T09:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: sending mial using SO_NEW_DOCUMENT_SEND_API1 :getting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096497#M1182817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt; 
data:   lwa_objpack type sopcklsti1,        "Contents of the Email
          li_objpack type standard table of sopcklsti1,
          lwa_reclist type somlreci1,         "Recievers List
          li_reclist type standard table of somlreci1,
          lwa_doc_chng type sodocchgi1,        "Mail Contents
          lv_line  like sy-tabix,     "Email Params
          objtxt  like solisti1   occurs 10 with header line.


  constants : lc_space type c value ' ',
              lc_1(15) type n value '1',         "Email Params
              lc_raw(3) type c value 'RAW',       "Email Params
              lc_u type c value 'U',              "Recipient Property
              lc_01 type c value '1',
              lc_x type c value 'X'.

clear: p_subject, p_msg, p_mail.

*  Filling Mail Contents
  lwa_doc_chng-obj_name = 'E-Mail'.
  lwa_doc_chng-obj_descr = 'Your Appointment has been booked'.

  objtxt = 'Hello ABC ,'.
  append objtxt.

   objtxt = 'BOOKING ID: AND171008330BAN'.
  append objtxt.

  objtxt = 'Your appointment is being booked with Dr.Andrew at Memorial Hospital 17-10-2008 at 3:30PM. Please produce this booking ID at the time of consultation'.
  append objtxt.

  objtxt = '     '.
  append objtxt.

  objtxt = 'Thanks and Regards'.
  append objtxt.

  objtxt = 'Appointment booking team'.
  append objtxt.

  describe table objtxt lines lv_line.

   read table objtxt index lv_line transporting no fields.
  lwa_doc_chng-doc_size = ( lv_line - 1 ) * 255 + strlen( objtxt ).


*  Pack to main body
  lwa_objpack-body_start =  lc_1.
  lwa_objpack-head_start = lc_1.
  lwa_objpack-head_num   = '0'.
  lwa_objpack-body_num   =  lv_line.
  lwa_objpack-doc_type   =  lc_raw.
  append lwa_objpack to li_objpack.



  translate p_mail to lower case.


*  Fill receiver list
  lwa_reclist-receiver     =  'abc at xyz.com'. "Email id
  lwa_reclist-rec_type     =  lc_u.
  append lwa_reclist to li_reclist.

call function 'SO_DOCUMENT_SEND_API1'
  exporting
    document_data                    = lwa_doc_chng
   put_in_outbox                    = lc_x
   commit_work                      = lc_x
  tables
    packing_list                     = li_objpack
   contents_txt                     = objtxt
    receivers                        = li_reclist
 exceptions
   too_many_receivers               = 1
   document_not_sent                = 2
   document_type_not_exist          = 3
   operation_no_authorization       = 4
   parameter_error                  = 5
   x_error                          = 6
   enqueue_error                    = 7
   others                           = 8
          .
if sy-subrc &amp;lt;&amp;gt; 0.
 message id sy-msgid type sy-msgty number sy-msgno
         with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.

if sy-subrc = 0.
    call function 'BAPI_TRANSACTION_COMMIT'.
  endif.


ENDFUNCTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 09:54:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096497#M1182817</guid>
      <dc:creator>agnihotro_sinha2</dc:creator>
      <dc:date>2009-02-06T09:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: sending mial using SO_NEW_DOCUMENT_SEND_API1 :getting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096498#M1182818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes those settings are mandatory&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 09:55:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096498#M1182818</guid>
      <dc:creator>former_member195383</dc:creator>
      <dc:date>2009-02-06T09:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: sending mial using SO_NEW_DOCUMENT_SEND_API1 :getting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096499#M1182819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi kalyan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this blog&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2009 10:00:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096499#M1182819</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-06T10:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: sending mial using SO_NEW_DOCUMENT_SEND_API1 :getting error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096500#M1182820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2009 07:13:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sending-mial-using-so-new-document-send-api1-getting-error/m-p/5096500#M1182820</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-13T07:13:28Z</dc:date>
    </item>
  </channel>
</rss>

