Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Using SAP Mailbox, FM:SO_DOCUMENT_SEND_API1

Former Member
0 Kudos

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.

4 REPLIES 4

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

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

0 Kudos

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.