‎2006 Jun 21 5:32 PM
Hi,
We have a program which calls 4 function modules using the addition 'STARTING NEW TASK'. The main program will be scheduled to execute in background. When program is scheduled in background, since it calls 4 different function modules in separate tasks, these are assigned to dialog work process and not to the background work process as the main program is assigned.
Since the FM code are being executed in dialog work process, we get dumps due to time-limit exceeded.
I need to know, is there any way where we can force these FM to execute using background work process and execute in parallel. The addition 'IN BACKGROUND TASK' also executes the code in a new dialog work process and not in background work process. Any other solution other than increasing the work process run time.
Hope you understand the problem. Please reply back if you need clarification.
Regards,
Sakthi.
‎2006 Jun 21 5:37 PM
‎2006 Jun 21 5:37 PM
‎2006 Jun 23 6:01 PM
Hi Peluka,
Thanks for the suggestion.
I cannot use UPDATE TASK addition since I need the data to be consistent. Each function module will do specific calculations and will return back the results. These results are collected in the main program and updated in the tables.
But using STARTING NEW TASK...PERFORMING...RECEIVE RESULTS addition, I am able to get back the results and maintain the consistency.
Any other ideas....
Regards,
Sakthi.
‎2006 Jun 23 6:26 PM
Hello Sakthi,
Have you considered using the option
CALL FUNCTION func IN BACKGROUND TASK ?
Just like you have the STARTING NEW TASK addition, the above addition also does an asynchronous call. However, I can see your problem. In case of STARTING NEW TASK, you can get the data back conveniently. But in case of BACKGROUND TASKS, there's no PERFORMING <formname> ON END OF TASK....
But you place the data from each of the function modules in the Shared Buffer. Then the Calling program can later on import the data from the shared buffer and delete it.
I know this is not so appealing, but i shall try to think of another idea....
Regards,
Anand Mandalika.
‎2006 Jun 23 6:38 PM
Hi,
Can you use the following approach ?
Instead of scheduling one program in background and making 4 asynchronous FM calls, have four programs scheduled in the background and let them all do processing of their own and update the database.
this would mean that your program design has to change a little bit, but we are effectively using parallel processing. Also, here there's no program which is waiting for the rest of the FM calls to return.
Regards,
Anand Mandalika.
Regards,
Anand Mandalika.
‎2006 Jun 27 5:20 PM
Hi
Thanks for the approach and ideas.
But I have changed all the function module calls as the ordinary calls (removed the parallel processing). The execution time taken was a bit more but it was OK.
I tried using 'IN BACKGROUND TASK' but even this executes the FM in a dialog work process and not in a background work process. Again the possibility of time_out error.
Also I could break this program into 4 programs but then I need to select the required data in all the 4 programs (There are >10 SELECT statements and each will pick up 16000 records).
So thought of using one background task and do the processes sequentially.
Thanks for the inputs.
Regards,
Sakthi.