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

parallel processing+execute in background

Former Member
0 Likes
1,300

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.

1 ACCEPTED SOLUTION
Read only

LucianoBentiveg
Active Contributor
0 Likes
898

Use "in update task", FMs run when program do a commit.

5 REPLIES 5
Read only

LucianoBentiveg
Active Contributor
0 Likes
899

Use "in update task", FMs run when program do a commit.

Read only

0 Likes
898

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.

Read only

0 Likes
898

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.

Read only

0 Likes
898

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.

Read only

0 Likes
898

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.