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: 

How to send a mail from report

Former Member
0 Kudos

Hi,

I am new to ABAP, Started with the basics in ABAP and now learning how to declare types,use paramters..

Requirement :

I have created a table the DDIC. and has some 10 entries in it. I am eager to know how to send the mail of the entries

available in the Table.  Please help me guide how to do it. Thanks in Advance.

Thanks,

Shankar.

Moderator message: frequently discussed, always search for available information before asking again (CL_BCS is the way to go).

Message was edited by: Thomas Zloch

2 REPLIES 2

Clemenss
Active Contributor
0 Kudos

Hi Shankar,

- read table entries into internal table

- WRITE contents to text table.

- send mail using CL_BCS (see sample reports BCS*

Regards

Clemens

P.S.: You could have searched Forum or internet.

former_member213851
Active Contributor
0 Kudos

Hi Shekhar,

You can   FM SO_DOCUMENT_SEND_API1.

Let us assume that you have  zemail_alert as table containing all Recipient's address.

First fetch email-ids in internal table  GT_EMAIL from your ztable as follows:

SELECT EMAIL_ID

FROM ZEMAIL_ALERT

INTO CORRESPONDING FIELDS OF GT_EMAIL.

LOOP AT GT_EMAIL INTO WA_EMAIL.

* Add the recipients email address

  CLEAR t_receivers.

  REFRESH t_receivers.

  t_receivers-receiver = WA_EMAIL-email_ID.  "Email ID field inZtable

  t_receivers-rec_type = 'U'.

  t_receivers-com_type = 'INT'.

  t_receivers-notif_del = 'X'.

  t_receivers-notif_ndel = 'X'.

  APPEND t_receivers.

ENDLOOP.

Now pass  t_receivers to SO_DOCUMENT_SEND_API1 .