Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Send mail through CL_BCS class with normal priority

Former Member
0 Kudos

Hello guys!!!

I'm trying to send email through CL_BCS class, and it's work fine!

But, always sent with high priority, and I need to send whith normal priority.

I tried this:

  DATA: o_send_request TYPE REF TO cl_bcs,
        o_document     TYPE REF TO cl_document_bcs.

  o_document = cl_document_bcs=>create_document(
                 i_type       = 'HTM'
                 i_text       = msgbody
                 i_subject    = subject
                 i_importance = '5' ).

And this:

  CALL METHOD o_send_request->send_request->setu_priority
    EXPORTING
      i_priority = o_send_request->cp_priority_normal.

Unfortunately, don't works.

Any idea?

Thanks!!!

Kleber S. Kiefer

4 REPLIES 4

former_member194669
Active Contributor
0 Kudos

May be try this way


data : y_send   type ref to cl_bcs.

  try.
    call method y_send->set_status_attributes
        exporting
          i_requested_status = 'N'.
      y_send->set_send_immediately( '' ).
      call method y_send->set_document
        exporting
          i_document = y_doc.
      y_send->set_priority( i_priority = '9' ). "<<<<< Set priority low
      catch cx_send_req_bcs into l_send.
      y_save y_str_msg l_send 'E'.
      return.
  endtry.

0 Kudos

set_priority( i_priority = '9' ) does not work.

Is there an other way to send emails without high priority?

Former Member
0 Kudos

I met the same problem. Is there any solutions for the email priority?

Thanks,

Miao

Former Member
0 Kudos

Hi,

Please try the following solution:

* set mail importance to normal
TRY.
lo_document ?= lo_send_request->document( ).
lo_document->set_importance( i_importance = '5' ).
CATCH cx_sy_move_cast_error.
ENDTRY.

In addition, in the Alert framework, which send emails with high priority, it controls the document's importance and then send out the emails with high priority.

* ---------------------------------------------------------------------
* create send request, document etc..
* ---------------------------------------------------------------------
    TRY.
        lo_document = cl_document_bcs=>create_document(
                              i_type = l_texttype
                              i_text = lt_text
                              i_importance = '1'
                              i_language = ls_langu_recipient-langu
                              i_subject = l_subject_short
                              i_length = l_so_obj_len ).