Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Why I can't find a mail in SOST?

By using the following coding, I expect to find a internet-mail in SOST (unsent, because it's a test system, but it has to be there).

What I'm doing wrong???

DATA: ex_bcs TYPE REF TO cx_bcs.

TRY.
     " create mail document
     DATA(mail) = cl_document_bcs=>create_document(
      i_text    = VALUE #( ( CONV so_text255( 'Testmail' ) ) )
      i_type    = 'RAW'
      i_subject = 'Testsubject' ).

     DATA(send_request) = cl_bcs=>create_persistent( ).
     send_request->set_document( mail ).
     send_request->set_sender( i_sender = cl_cam_address_bcs=>create_internet_address( 'test@test.de' ) ) ##NO_TEXT.
     send_request->add_recipient( i_recipient = cl_cam_address_bcs=>create_internet_address( 'test@test.de' ) ).

   CATCH  cx_address_bcs
          cx_send_req_bcs
          cx_bcs
          INTO ex_bcs.
     MESSAGE ID ex_bcs->msgid TYPE ex_bcs->msgty NUMBER ex_bcs->msgno
     WITH ex_bcs->msgv1 ex_bcs->msgv2 ex_bcs->msgv3 ex_bcs->msgv4.
ENDTRY.

" do not forget to commit, otherwise the mail will not be sent!
IF send_request->send( i_with_error_screen = abap_true ) = abap_true.
   COMMIT WORK.
ENDIF.

" I expect to find an SOST entry, now.

Tags:
replied

Hi Ralf,

there is no error in your code: I've pasted your code to a Z report and i've the test email waiting in SOST with yellow status.

Maybe something with customizing ? ....

Regards

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question