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: 

Why I can't find a mail in SOST?

ralf_wenzel_heuristika
Active Participant
0 Kudos

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.

1 ACCEPTED SOLUTION

former_member210541
Active Participant
0 Kudos

add this at the end of your code

SUBMIT RSCONN01

                    AND RETURN.

11 REPLIES 11

raymond_giuseppi
Active Contributor
0 Kudos

I suppose the background job scheduled to send mail is not active (check with transaction SCOT) you could manually execute report RSCONN01.

Regards,

Raymond

0 Kudos

But in this case, I have to see the unsent mail with a yellow status indicator in SOST.

Principially, mailing works, there MUST be an error in my coding.

0 Kudos

Are you sure it is not in SOST?

Change max no of hits on period tab to and at send status tab add all options. Or tick the first checkbox in the Options tab.

0 Kudos

Could you check SCOT for "routing" rules?

former_member186746
Active Contributor
0 Kudos

Hi,

Are the settings in SCOT correct?

Sometimes there are filters active prohibiting certain addresses.

Kind regards, Rob Dielemans

0 Kudos

SOST works as expected, there are masses of mails "waiting for communication service" (yellow status light), but only my mails do not arrive there

former_member210541
Active Participant
0 Kudos

add this at the end of your code

SUBMIT RSCONN01

                    AND RETURN.

0 Kudos

This report will send the whole SOST queue, right? There are hundreds of "yellow" mails, which shouldn't be sent.....

0 Kudos

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

0 Kudos

OK, if YOU tell me, that in your system my coding is working fine, I know that my coding is correct and I have to check the customizing.

Thank you very much!!!!

0 Kudos

You can see it in the image attached, also i've checked some working examples here in my system with BCS classes and the code is essentially the same.

I was thinking, maybe something related about your user's authorizations or roles? .

Regards,