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: 

Sending PDF to multiple recipients

Former Member
0 Kudos

Hi,

I have a requirement in which i have to send the PO details to the person who has created/changed the PO and to the person who has created PR as an PDF attachment. I am using the function modules ADDR_GET_NEXT_COMM_TYPE - to set the recipient details and CONVERT_COMM_TYPE_DATA - to convert the output to PDF format.

If the persons who has changed the PO and the one who has created the PR are different then i need to send the PDF to two users. Kindly let me know the possibilities to send the PDF to more than one person so that i can proceed on this.

Thanks in Advance,

Shaju

3 REPLIES 3

former_member223537
Active Contributor
0 Kudos

http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm

REfer the above program & add recepients to it.

former_member194669
Active Contributor
0 Kudos

Hi,



Loop at i_receipents .  "<<<< put the receipients in a loop

 Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.

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
contents_bin = t_attachment
contents_txt = it_message
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.

endloop.

Former Member
0 Kudos

Hi Shaju,

Use FM <b>CONVERT_OTF_2_PDF</b> : to convert the output to PDF format.

and the use FM <b>SO_NEW_DOCUMENT_ATT_SEND_API1</b> : To Send new document with attachments using RFC

Rewrd points if helpful.

Regards,

Hemant