2009 Aug 27 11:34 AM
Hi,
I have a requirement to update a z table.If the update is successful, commit work should be done.
If the update is not successful an error has to be reported.
All the errors reported in the program should be sent through an email to a particular addresse.
How to send the email from the report program?
2009 Aug 27 11:37 AM
Hi,
Use following FM to send a mail
Call Function Module to sen the mail
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = ls_doc_change "Attribute of new document
put_in_outbox = gc_chk "Flag: Move document to outbox after send
commit_work = gc_chk "Execute explicit commit works at end of function module
TABLES
packing_list = gt_pack_list "Information about structure of data tables
contents_hex = gt_attach "Obsolete - see CONTENTS_HEX
contents_txt = gt_message "ASCII contents of object and attachments
receivers = gt_reciever "Document recipients with send attributes
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.
IF sy-subrc EQ 0.
"#EC NEEDED
Mail Successfully Delivered
ENDIF.
Regards,
Prashant