Skip to Content
0
Former Member
Nov 14, 2011 at 12:39 PM

Send Mail with CL_BCS-status 'still no entry in queue' although commit work

854 Views

Hi,

i use the BAdI HRBAS00INFTY~IN_UPDATE to send Mails when a training has changed.

To send a Mail i use the class CL_BCS.

After calling CL_BCS->send ( ) i'm using commit work.

When the BAdi is called by the transaction lso_psv1 or lso_psv2 all works fine.

If i change a Infotype in transaction PP01 the BAdI is also called and the class CL_BCS is called with the same paramerters.

After commit work the mail appears in the queue (TA SOST) with the same Massage-ID, but the status is 'still no entry in queue' .

I hope somebody knows a solution!

Regards

Reinhard

Here the test-coding:

  DATA:
        mail_lr           TYPE REF TO cl_bcs,
        mail_body_lr      TYPE REF TO cl_document_bcs,
        mail_sender_lr    TYPE REF TO if_sender_bcs,
        mail_receiver_lr  TYPE REF TO if_recipient_bcs,
        exeption_bcs_lr   TYPE REF TO cx_bcs,     "#EX NEEDED
        exeption_lr       TYPE REF TO cx_root,
        err_text_lv       TYPE        string,
        subject_lv        TYPE        so_obj_des,
        line_la           type        soli,
        text_lt           type        soli_tab,
		bool_lv           Type        os_boolean.
  

		line_la = 'TestMail'.
		append line_la to text_lt.
		subject_lv = 'Test-Mail-Subject'.
      TRY.
          mail_lr = cl_bcs=>create_persistent( ).

          mail_body_lr = cl_document_bcs=>create_document(
            i_type      = 'RAW'            
            i_text      = text_lt
            i_subject   = subject_lv ).

          mail_lr->set_document( mail_body_lr ).

          mail_receiver_lr = cl_cam_address_bcs=>create_internet_address( 'here is the receiver mail' ).

          mail_lr->add_recipient(
            i_recipient   = mail_receiver_lr
            i_express     = 'X'
            i_copy        = ' '
            i_blind_copy  = ' '
            i_no_forward  = ' '
            ).

          mail_sender_lr = cl_cam_address_bcs=>create_internet_address( 'here is the sendermail' ).

          mail_lr->set_sender(
            i_sender = mail_sender_lr ).

          mail_lr->set_send_immediately( abap_false ).

          call METHOD mail_lr->send(
            EXPORTING i_with_error_screen = 'X'
            RECEIVING result = bool_lv ).
		  COMMIT WORK.	


        CATCH cx_bcs INTO exeption_bcs_lr.
      ENDTRY.
      IF exeption_bcs_lr IS INITIAL.

      ENDIF.