11-11-2009 11:18 AM
Dear Experts,
I have a problem in sending mails from sap to internet address.Am using the function module
SO_NEW_DOCUMENT_SEND_API1 and am passing parameters like,
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_TYPE = 'RAW'
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
TABLES
OBJECT_CONTENT = OBJCONT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
My problem here is,with the commit work statement after FM, the mail is triggering correctly.but if, am not using the commit work statement,at the very first time of execution mail is not triggering, and the second time of execution first mail is triggering like wise it is going.The status of the message is waiting in queue.
i have refresh receiver's list also.I want to use this concept in badi.So anyone can pls help me,how to send a mail without commit work statement.
Thanks in advance.
11-12-2009 6:19 AM
Hi,
It is not necessary to set the commit variable in the function module.
Eventhough the submit statement is not called the mail will be send based on the config in SCOT.
The timedelay in mail sending can be checked by using the following path.
SCOT ->Settings -> Send Jobs-> dbl click SMTP mail and check the value in the Period field
Regards,
Ginu Litta Raj
11-11-2009 12:30 PM
There is a parameter Commit_Work pass it as 'X'
<code>
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
DOCUMENT_TYPE = 'RAW'
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
commit_work = 'X'
TABLES
OBJECT_CONTENT = OBJCONT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
</code>
Edited by: Saravanan Ramasamy on Nov 11, 2009 1:31 PM
11-11-2009 12:35 PM
You can use Commit Parameter of the same API. In this way you can aviod Explicit Commit Work Statement.
Regards,
J.
11-12-2009 5:00 AM
Hi Sekhar,
Thanks for ur reply.If i use commit parameter in same API , will it work as global or local?
Bcoz i want to cal this FM in Badi two times.In this case am getting short dump.At the same time if i cal the FM one time it is working fine.Pls help me on this.
Thanks in advance.
11-12-2009 6:19 AM
Hi,
It is not necessary to set the commit variable in the function module.
Eventhough the submit statement is not called the mail will be send based on the config in SCOT.
The timedelay in mail sending can be checked by using the following path.
SCOT ->Settings -> Send Jobs-> dbl click SMTP mail and check the value in the Period field
Regards,
Ginu Litta Raj