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: 

Reg : Delay mail timing through ABAP programming

Former Member
0 Kudos

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.

10 REPLIES 10

kakshat
Advisor
Advisor
0 Kudos

You can put a WAIT statement at the end of your program and send the second mail after that.

Former Member
0 Kudos

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.

0 Kudos

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.

Former Member
0 Kudos

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

0 Kudos

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.

Former Member
0 Kudos

hi akshat,

        we dint have authorization for Background triggering  in our server, so that i am approaching you for another solution. thanks in advance

0 Kudos

Maybe you can try CALL FUNCTION STARTING NEW TASK.

Former Member
0 Kudos

You could also create a workflow and wait for events. Trigger events from your programs. Pretty straight forward.

Former Member
0 Kudos

Use WAIT for 300 SECONDS and then trigger the second mail in the program.

0 Kudos

Thanks Johnson, but using wait does not meet my requirement. Please see my 1st reply to

Kumar Akshat.