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: 

Need help: Sending mail to internet address without commit work statement

Former Member
0 Kudos
131

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
53

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

4 REPLIES 4

Former Member
0 Kudos
53

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

0 Kudos
53

You can use Commit Parameter of the same API. In this way you can aviod Explicit Commit Work Statement.

Regards,

J.

0 Kudos
53

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.

Former Member
0 Kudos
54

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