‎2007 Mar 03 9:12 AM
Hi guys,
I need a Function Module that generate a mail to a person
when the Program run
Regards,
Surjith
‎2007 Mar 04 12:26 PM
Call the function module to send the mail
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_type = lc_raw
document_data = gs_doc_chng
put_in_outbox = gc_x
commit_work = gc_x
TABLES
object_header = gt_objhead
object_content = gt_objtxt
receivers = gt_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
CASE sy-subrc.
WHEN 0.
SKIP.
FORMAT COLOR 3 ON.
WRITE:/ 'Mail has been sent successfully to below mentioned IDs:->'(005)
.
FORMAT COLOR 3 OFF.
WRITE:/ p_dlist.
WRITE:/ sy-uname.
WHEN 1.
WRITE: / 'Too many receivers specified !'(017).
WHEN 2.
WRITE: / 'No receiver got the document !'(018).
WHEN 4.
WRITE: / 'Missing send authority !'(016).
WHEN OTHERS.
WRITE: / 'Unexpected error occurred !'(019).
ENDCASE.
‎2007 Mar 05 4:31 AM
‎2007 Mar 05 7:11 AM
Hi,
If u want to send a mail to SAP INBOX then u can use the FM's given below.
<b>Z_SEND_MAIL_PROGRAM_COMPLETE</b> - Send SAPOffice Mail stating that a program has completed.
<b>Z_SEND_SAPOFFICE_MAIL</b> - Send SAPOffice Mail to User.
Suppose in your scenario may be u want to send a mail to the user after completing the program execution. Then we can use these FM's to send a mail to the users.