Skip to Content

SAP Email with CL_BCS

Hi all,

I'm facing a problem when sending a email with CL_BCS class.

which is for each email i send through this class will automatically generate a delivery email. So i want to remove this delivery notification mail...

I went through the discussions but i couldn't found the solution...

please let me know the solution..



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on May 09, 2013 at 08:13 AM

    Method set_status_attributes with parameters

    i_status_mail - determines action according to status of mail

    i_requested_status - request confirmation

    Both use:

    N = Never

    E = Only if errors

    D = if transferred

    R = if read

    A = always

    I use cl_send_request_bcs=>no_status which is 'N', for both.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 09, 2013 at 08:13 AM

    Hi Pathum,

    Please check the below document composed by me.

    This document will be helpful in using CL_BCS.

    Pass the same parameters as it was mentioned in the document.

    Hope this solves your problem.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 09, 2013 at 08:46 AM

    Copy your program snippet here please, with the part where you are using those methods. It can be helpful for us.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      here is my coding and it works, but i have no attachment in this case:


      lt_objtxt type table of solisti1
      ,ls_objtxt type solisti1


      lo_send_request type ref to cl_bcs
      ,lo_document type ref to cl_document_bcs
      ,lo_bcs_exception type ref to cx_bcs
      ,lo_recipient type ref to if_recipient_bcs
      ,ls_rec type SOOS1
      ,sent_to_all type os_boolean
      *** Mail-Text-Inhalt erstellen
      ls_objtxt = 'Textzeile 1:'.
      append ls_objtxt to lt_objtxt.

      *** Sendrequest erzeugen
      lo_send_request = cl_bcs=>create_persistent( ).

      *** Dokument (Mailtext) erzeugen
      call method cl_document_bcs=>create_document
      i_type = 'RAW'
      i_subject = lbl_s141 " Title für die Mail
      i_text = lt_objtxt
      result = lo_document.

      *** Die Mail an den Sendrequest hängen
      call method lo_send_request->set_document( lo_document ).

      ls_rec-recesc = 'U'.
      ls_rec-recextnam = p_rec.

      CALL METHOD cl_send_request_bcs=>create_recipient_from_soos1
      i_soos1 = ls_rec
      result = lo_recipient.
      CATCH cx_send_req_bcs .

      call method lo_send_request->set_status_attributes
      i_requested_status = 'N'
      i_status_mail = 'N'.
      catch cx_send_req_bcs .

      *** ---------- send document ---------------------------------------
      call method lo_send_request->send(
      i_with_error_screen = 'X'
      result = sent_to_all ).
      if sent_to_all = 'X'.
      write text-003.

      commit work.

      * -----------------------------------------------------------
      * Ausnahmebehandlung
      * -----------------------------------------------------------
      catch cx_bcs into lo_bcs_exception.
      write: text-001.
      write: text-002, lo_bcs_exception->error_type.



      Thank you.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.