Application Development and Automation 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: 
Read only

BCS - Send Email

Former Member
0 Likes
1,366

Hi,

I have a request where i need to send a email to approvers of a specific order,

The problem is i dont think bcs is properly configured in my system or the code i am using is incorrect.

My Code is based on the following link: http://wiki.sdn.sap.com/wiki/display/Snippets/Sending+mail+with+attachment+using+Object+Oriented+App...

The code is pretty much the same actually, i have only commented the attachments part as it isnt necessary in our business logic.

When debugging the code everything seems to go on as expected ( even the last send result equals 'X').

But i am not receiving the emails, so i am going to the transaction SOST and SCOT to see if they are in the queue but nothing appers aswell.

How could i test if my BCS is working properly in this system?

i have used a Test report called "RSBCS_EXAMPLE_EMAIL" and everything works i receive the email as expected

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,210

You should use COMMIT WORK after  lo_send_request->send.

3 REPLIES 3
Read only

Former Member
0 Likes
1,211

You should use COMMIT WORK after  lo_send_request->send.

Read only

kumud
Active Contributor
0 Likes
1,208

Commit Work is there in the code that has been shown in the wiki link.

With result = 'X', it shows that the mail was sent. I would suggest verify, if recipients and all other parameters are populated correctly in debugging and then you could add the below code to catch any exception triggered. Current code does not catch any exception while sending. It might give you a hint of the problem.

DATA: bcs_exception type ref to cx_send_req_bcs.

catch cx_send_req_bcs into bcs_exception.
Message i001(msgclass) with bcs_exception->error_type

endtry.

You could consequently check other parmaters that are returned by the constructor of class CX_SEND_REQ_BCS.

I would also suggest add a message after send method saying if result is initial mail was not sent to

the recipients else it was sent.

You can always check with your basis guys for any setting that is required to be done. Thanks.

Regards,

Kumud

Read only

0 Likes
1,208

Thanks for the replys i managed to realize the problem with the help of this exception trace.

One of the recipients was in incorrect format