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

To pass multiple email id in function module 'SO_NEW_DOCUMENT_ATT_SEND_API1

former_member288488
Participant
0 Likes
1,021

Hello Experts,

My requirement is to send email to multiple email id from my abap program.every thing is working fine for me, i'm using the function module 'SO_NEW_DOCUMENT_ATT_SEND_API1' but the only problem i'm facing is i'm not able to send mail to multiple id's. I can only do it for single email id.

I'm populating the it_receivers internal table as below:-

clear it_receivers.

refresh it_receivers.

it_receivers-receiver = 'EMAILID'.

it_receivers-rec_type = 'U'.

  • it_receivers-com_type = 'INT'.

it_receivers-express = ' '.

  • it_receivers-notif_ndel = 'X'.

append it_receivers.

call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'

exporting

document_data = gd_doc_data

  • put_in_outbox = 'X'

commit_work = 'X'

  • importing

  • sent_to_all = gd_sent_all

tables

packing_list = it_packing_list

contents_txt = it_message

receivers = it_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.

Please let me know how can I pass multiple email id's here.

Thanks,

Naveen

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
580

Hello,

You can send to multiple email ids. Set the parameter,

SENT_TO_ALL = 'X'

This should help you to send to multiple users.

Regards,

Anila

3 REPLIES 3
Read only

Former Member
0 Likes
581

Hello,

You can send to multiple email ids. Set the parameter,

SENT_TO_ALL = 'X'

This should help you to send to multiple users.

Regards,

Anila

Read only

0 Likes
580

Hi Anila,

How do i define this parameter, i'm getting the error as below.

Function module "SO_NEW_DOCUMENT_ATT_SEND_API1" was called

with the parameter "SENT_TO_ALL".

This parameter is not defined.

Thanks a lot,

Naveen

Read only

0 Likes
580

Hi,

If you want to send to multiple Email id's., You need to append all those Email id in the RECEIVERS table.

clear it_receivers.

it_receivers-receiver = 'EMAILID'.

it_receivers-rec_type = 'U'.

append it_receivers.

clear it_receivers.

it_receivers-receiver = 'EMAILID1'.

it_receivers-rec_type = 'U'.

append it_receivers.

clear it_receivers.

it_receivers-receiver = 'EMAILID2'.

it_receivers-rec_type = 'U'.

append it_receivers.

Thanks

Arul