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

Is it possible to send multiple e-mails via sapscript?

Former Member
0 Likes
1,107

Hello evceryone,

I have a requirement that, we are getting an output via VL02N and this one output is being send to an e-mail recepient.

While sending e-mail, the program uses CONVERT_COMM_TYPE_DATA FM to send e-mail(s) if I am not wrong!

Sapscript is being used to display output and send e-mail.

Do you have any idea about How I can send mutliple e-mail(s) using sapscript?

5 REPLIES 5
Read only

Former Member
0 Likes
939

Hi

add the recievers in internal table, use  this function module and send mail,

CLEAR T_RECEIVERS.

REFRESH T_RECEIVERS.

WA_RECEIVERS-RECEIVER = LD_EMAIL.

WA_RECEIVERS-REC_TYPE = 'U'.

**WA_RECEIVERS-REC_TYPE = 'C_U'.

WA_RECEIVERS-COM_TYPE = 'INT'.

WA_RECEIVERS-NOTIF_DEL = 'X'.

WA_RECEIVERS-NOTIF_NDEL = 'X'.

<b>APPEND WA_RECEIVERS TO T_RECEIVERS</b>.

<b>CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

DOCUMENT_DATA = W_DOC_DATA

PUT_IN_OUTBOX = 'X'

SENDER_ADDRESS = LD_SENDER_ADDRESS

SENDER_ADDRESS_TYPE = LD_SENDER_ADDRESS_TYPE

COMMIT_WORK = 'X'

IMPORTING

SENT_TO_ALL = W_SENT_ALL

TABLES

PACKING_LIST = T_PACKING_LIST

object_header = wa_objhead

CONTENTS_BIN = T_ATTACHMENT

CONTENTS_TXT = IT_MESS_BOD

RECEIVERS = T_RECEIVERS

EXCEPTIONS

TOO_MANY_RECEIVERS = 1

DOCUMENT_NOT_SENT = 2

DOCUMENT_TYPE_NOT_EXIST = 3

OPERATION_NO_AUTHORIZATION = 4

PARAMETER_ERROR = 5

X_ERROR = 6

ENQUEUE_ERROR = 7

OTHERS = 8.

Read only

0 Likes
939

Hello Srinivas,

But I don't have OTF data right now! Is this FM module going to work without providing OTF data ?

Thanks.

Read only

Former Member
0 Likes
939

Hi Taner,

Yes you can send multiple email thru SAPscripts. All you have to do is include all recipients in SE37-> FM: SO_DOCUMENT_SEND_API1.

Cheers,
Rod

Read only

0 Likes
939

Hello Rodel,

But I don't have OTF data right now! Is this FM module going to work without providing OTF data ?

Thanks.

Read only

Former Member
0 Likes
939

It is only possible if you can change print/Driver program which you have put in NACE tcode.