Using SAP Mailbox, FM:SO_DOCUMENT_SEND_API1
Hi ABAP gurus,
Thanks for your time on my query.
I have a very typical issue with sending emails to external email IDs.
1. We have an output (ABCD) from Billing documents, which sends Delivery Confirmation document by email, by deriving the email ID from the ship-to-party master data from the Billing document.
2. the output ABCD is processed by a batch job, which collects ABCD outputs from all the possible Billing Documents and processes at a time.
3. Now the issue is, for eg: if 500 ABCD outputs are processed successfully, it has 500 successful entries in NAST table.
4. but atleast 20% of the emails are missed to sent, which means only 400 correspondings entries are present in SOST table and the remaining 100 emails are missed and so not available in SOST table.
5. Again if we reprocess the missed out outputs they are sent successfully and the entries are available in SOST.
The FM: SO_DOCUMENT_SEND_API1 is used to send external emails
The following routine does that in our output program:
FORM send_mail TABLES lt_outtab
CHANGING i_sender_addr LIKE soextreci1-receiver
e_rc LIKE sy-subrc.
DATA : l_sent_to_all(1) TYPE c.
Completing the recipient list
reclist-receiver = i_receiver_addr. "Email Address
reclist-rec_type = 'U'. "Address Type = External
reclist-notif_ndel = 'X'. "Notify of non-delivery
Sending the document
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
sender_address = i_sender_addr
sender_address_type = 'SMTP'
document_data = doc_chng
packing_list = objpack
object_header = objhead
contents_txt = objtxt
receivers = reclist
OTHERS = 99.
e_rc = sy-subrc.
Can some one suggest what could have been wrong with the FM usage or the code or anything else.
thanks & regards