‎2010 Aug 08 6:20 PM
Hi,
I have a requirement where I have to trigger the mail on selecting certain screen elements as below:-
1.) On pressing the pushbutton on the custom screen the mail should be sent to the email id's given. I have the body of the email to be sent.
2.) On selecting the respective values from the drop down in the I/O selection screen element the respective email should be sent.
Please respond to the query at the earliest.
Thanks,
Naveen
‎2010 Aug 10 6:58 PM
Hi,
you just need to use the function module when the user presses the send mail button or whatever button u provide him.
'SO_NEW_DOCUMENT_ATT_SEND_API1'
check even these :
sap_new_document_send_api1(send document)
sap_new_document_att_send_api1(send with attachments) .
Hope this solves your problem.
and ya one more thing, you need to check with your BASIS guys whether they have provided you the option of sending mails to external ids.
Cordially,
Danish
‎2010 Aug 12 4:06 AM
SAP has provided you with the ability to reuse their Business Communication Services (BCS) email class CL_BCS ... have a look in SE38 at the programs that start with BCS_* as there are lots of sample pieces of code there that you can easily reuse. Do note the need for a "commit work" to trigger the send.
Jonathan
‎2010 Aug 12 4:45 AM
Hi,
You need to use FM 'SO_DOCUMENT_SEND_API1' to send mail. Please refer below code to call it. To use this, you need to have your internal table in binary format. In below code 'T_ATTACHMENT' is the internal table with binary format.
So, you need to convert your internal table into binary format and then use this FM to send mail.
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.Thanks,
Archana
Edited by: Archana Pawar on Aug 12, 2010 5:45 AM
Edited by: Archana Pawar on Aug 12, 2010 5:45 AM
‎2010 Aug 12 11:46 AM
Hi,
Please let me know how to proceed on this as i have the body and id where i need to send the mail.
Thanks,
Naveen Sharma