Application Development and Automation 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: 
Read only

Problem in mail sending

Former Member
0 Likes
442

Hi experts,

I am using FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send an mail to internaet address. There is explicit COMMIT WORK written after FM call.

I have scheduled a job in Production to so. But it is not working. No mail is sent when i checked in SOST.

Also When I run the program in foreground it works fine and sends mail.

Please suggest.

Hi experts,

I am using FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send an mail to internaet address. There is explicit COMMIT WORK written after FM call.

I have scheduled a job in Production to so. But it is not working. No mail is sent when i checked in SOST.

Also When I run the program in foreground it works fine and sends mail.

Please suggest.

2 REPLIES 2
Read only

Former Member
0 Likes
401

Hi,

When you schedule a job, check whether the user(in the step definition) has enough authorizations to send mail. Check the SCOT setting also in meantime. Also check in the your SAP outbox.

Contact the Basis for the same, they can help.

Regards,

Aditya

Read only

Former Member
0 Likes
401

Hi vinit,

Adding to Aditya's post you can also write below code after calling function module SO_NEW_DOCUMENT_ATT_SEND_API1.

SUBMIT rsconn01 WITH mode = 'INT'

WITH output = 'X'

AND RETURN.

IF sy-subrc <> 0.

WRITE:/ 'Error When Sending the File', sy-subrc.

ELSE.

WRITE:/ 'Mail sent'.

ENDIF.

This rsconn01 program is used to send file from application server to SMTP. so there is no need to go to SOST, SCOT, SBWP for sening mails.

Also you can check from SCOT transaction. if you find documnets are pending in SCOT then execute the send process.

it will work for you.

As you mentioned you have scheduled a job in production system and it's not working. The reason behind this may be heavy load on background workprocessor. Usually in production system a bunch of background jobs run simultaneously so the less priority jobs will have to wait. You can see it either tranaction sm50 also. You change the job priority to high. May be it will work.

Regards,

Sourabh Batwara

Edited by: Sourabh Batwara on Nov 25, 2009 2:55 PM