cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Send mail using cl_bcs via SAP distribution list

dschiener
Participant
707

Hi,

I want to send a mail by using class cl_bcs and a SAP internal distribution list.

That means, I want to create a SAP internal distribution list via SBWP, eg:
Screenshot 2024-08-26 175419.png

Then I want to maintain the mail addresses of recipients in this distribution list.

Then I want to send a mail to this distribution list.

Please do NOT provide any solutions by using deprecated FM SO_NEW_DOCUMENT_SEND_API1!

How could this work? Any got an idea? How can I specifcy / create a recipient object that refers to the distribution list?

BR

Accepted Solutions (1)

Accepted Solutions (1)

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert

Hello,
did you search? Answer and example codes can be found in few seconds on the internet.

Try class cl_distributionlist_bcs 

dschiener
Participant

@Tomas_Buryaneksorry for my late replay. You are right.

Believe me or not but in my first attempt I didn’t find any acceptable solutions on Google. But yes, as you already mentioned, there are many of them:

https://community.sap.com/t5/application-development-discussions/sending-mail-to-a-distribution-list...

https://medium.com/@zzcvgqtn/sending-email-to-distribution-list-dl-sap-abap-21719a4150f6

When implementing I was wondering, why none of the mails has been in sent. Analyzing the mails via SOST showed them in an invalid unqueued state. 

The trick to solve this is to call COMMIT WORK explicitly. Took me some minutes to figure out. 

BR

Answers (0)