2012 Dec 14 5:40 AM
Hi all,
I am doing a development where I need to send mails to customers from SAP. The concept is that i need to send a mail at the time when a program( ZAUTH_CHK ) is executed fully. Then another mail in the delay of 5mins through the same program(ZAUTH_CHK) but with different message. This program will be executed only once. I should modify the code such that this mail should be sent only after 5MINS from the time of 1st mail sent. Please give your suggestions.
2012 Dec 14 5:58 AM
You can put a WAIT statement at the end of your program and send the second mail after that.
2012 Dec 14 6:07 AM
Hi akshat,
I want the program output to be displayed before sending the second mail. so i conclude that the second mail should trigger only after entire process is over. WAIT usage making the program to wait till that time without displaying the output.which i don't need.
2012 Dec 14 6:19 AM
In that case, you can probably use a background job and event approach. You can create an event in transaction SM62 and raise that event in your report. Then, create a background job (SM36) which you can configure to be triggered on the created event. You can attach another Z program which will take care of sending the second mail. You can check if the job configuration allows you to add a delay of 5 minutes (I don't remember clearly), else you can add the wait at the beginning of the Z program.
2012 Dec 14 7:04 AM
Thanks for your response akshat. But can you make the same still simpler? because I am waiting to do with coding or with any change in SOST. I done need to run background job with creating new program, events etc. waiting for your response
2012 Dec 14 7:10 AM
You can do another thing. You can create an FM, put a wait statement at its beginning and write coding inside it to send the second email. Then, at the end of your first program, you can call the FM in background task.
2012 Dec 14 7:21 AM
hi akshat,
we dint have authorization for Background triggering in our server, so that i am approaching you for another solution. thanks in advance
2012 Dec 14 7:32 AM
2012 Dec 14 6:19 PM
You could also create a workflow and wait for events. Trigger events from your programs. Pretty straight forward.
2012 Dec 14 6:23 AM
Use WAIT for 300 SECONDS and then trigger the second mail in the program.
2012 Dec 14 7:07 AM
Thanks Johnson, but using wait does not meet my requirement. Please see my 1st reply to