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

WAIT UNTIL statement

praveen_kumar194
Active Contributor
0 Likes
1,773

Hi All,

We got one requirement where we have one report program which will send out emails in bulk ( 400 K ). The entire logic sending out email is located inside a loop condition. Our business wants to send 10k mails at a time and there should be a gap of 3 hours and then send again 10k mails. Like this job has to run.

Is it ok to put WAIT statement for 3 hours at the end of the loop to control the duration. I really search for side effects wait statement but could not get any answer. Please give your valuable input.

8 REPLIES 8
Read only

JerryWang
Product and Topic Expert
Product and Topic Expert
0 Likes
1,186


Hi Praveen,

why don't you schedule the report as a background job with time interval = 3 hours?

Best regards,

Jerry

Read only

Katan
Active Participant
0 Likes
1,186

Hi Praveen,

You could actually schedule the program within itself to start again in three hours time.  See FM JOB_OPEN and check out its documentation, which explains it's use.

Sending out 400K emails is quite a lot.  Double check if this is absolutely necessary and hopefully it is not something that needs to be periodically repeated, as I can see that this solution will only smooth over any performance issues you are facing without really tackling the problem.

Regards,

Katan

Read only

JJosh
Active Participant
0 Likes
1,186

Hi Praveen,

I got a suggestion.

Making a program wait for  hours does not make sense.

Add a condition for sending only 10K emails at a time and schedule the report for every 3 hrs and in the next batch send the next 10K emails.

Here you might have an issue for selecting the records for the 2nd batch execution. To solve this for already processed records, you can update a STATUS field in table. If this is a standard table, then store the fetched records to a temp table and set the status, so that you can cross check the already processed records and daily u can refresh this temp table based on creation date.

Regards,

Josh 

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,186

Hi Praveen

You can schedule a job which will start after 3 hours to send the next set of emails. It will be sort of recursive till all email are send.

First time program run it send 10K emails and schedule a job for the program to start after 3 hours to send next 10K. Same goes on till all are sent. You have to keep track of what all have been sent and what is pending

Nabheet

Read only

faisal_pc
Active Contributor
0 Likes
1,186

Hi Praveen,

Wait Until doesn't seems to be working for 3 hours. Schedule a job to run in 3 hours with different variants. I mean in the first variant give first 10000 mail recipient addresses, second one next 10000 addresses and so on..

Thanks,

Faisal

Read only

koolspy_ultimate
Active Contributor
0 Likes
1,186

hi,

   Try with different selection parameters with report  RSCONN01 (Schedule this report in BG as per your required intervals).



Regards,

Madhumahesh.

Read only

yogendra_bhaskar
Contributor
0 Likes
1,186

This message was moderated.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,186

Don't call RSCONN01 within your report, but change value of "maximal Maximum No. of Send Requests" in a copy of variant SAP&CONNECTINT or similar standard variant, then schedule it with a period of 3 hours.

Regards,

Raymond