11-15-2007 2:14 PM
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.
Technical:
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.
REFRESH reclist.
CLEAR reclist.
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
APPEND reclist.
Sending the document
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
sender_address = i_sender_addr
sender_address_type = 'SMTP'
document_data = doc_chng
TABLES
packing_list = objpack
object_header = objhead
contents_txt = objtxt
receivers = reclist
EXCEPTIONS
OTHERS = 99.
e_rc = sy-subrc.
ENDFORM.
================================================
Can some one suggest what could have been wrong with the FM usage or the code or anything else.
thanks & regards
Siva.
11-15-2007 4:01 PM
sap version ECC 6.0
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
sender_address = i_sender_addr
sender_address_type = 'SMTP'
document_data = doc_chng
COMMIT_WORK = 'X'
TABLES
packing_list = objpack
object_header = objhead
contents_txt = objtxt
receivers = reclist
EXCEPTIONS
OTHERS = 99.
11-16-2007 4:43 AM
Hi George & all,
Currently we are using 4.6C version and there is no COMMIT WORK parameter in the FM. Please advise how can I proceed further.
Thanks & Regards
Siva
11-16-2007 5:13 AM
Ok if you don't have COMMIT WORK In the FM, you can try with the explicit COMMIT WORK after your FM call.
Regards,
Naimesh Patel
11-19-2007 6:30 AM
Hi Patel & others,
But already I am using "SUBMIT rsconn01 AND RETURN" immediately after the send_emails routine.
Can please let me know having an explicit "Commit_Work" immediately after Call Function will be much useful? If so how it will be?
thanks & regards,
Siva.