05-26-2011 7:42 AM
Hi,
I am creating a program which calls a function, becuse the function gets list of 2000 employess and run for long time over the amount of employees i wrote "call function zxxxxx starting new task p_task_number...."
My question is - how many tasks can i create ? can i run the function in 10 tasks (20 employees in each task)????
thanks
Elad
05-26-2011 7:49 AM
05-26-2011 8:45 AM
Hi Amir,
When you are calling the FM in starting new task, you are using up a Dialog work process on the app server, so the no of calls you make is dependent on the no of dialog work processes available in your landscape.
You can use SM51 to see the no of app servers(double click on each one of them to see the no of WPs) and SM50 to see the no of WP details on the server you are logged in.
You should be care careful on how many calls you spawn from your program, refer the below link on which a similar question was answered, look for the last response on this post.
Regards,
Chen
05-26-2011 8:46 AM
The limit is the number of available dialog work processes, minus a few that should remain available for all other users.
You can determine the number of available processes by calling SPBT_INITIALIZE.
Also read the detailed SAP online documentation about asynchronous RFC (aRFC).
Thomas
05-26-2011 9:47 AM
Ami,
You are using it wrongly.
CALL FUNCTION func STARTING NEW TASK task1
here "task1" is just a name and defining it with a number will not make any impact on performance.
try CALL FUNCTION func STARTING NEW TASK task1 DESTINATION dest IN GROUP DEFAULT, this will enable to run FM in groups (parallel processing) and might help in performance as will itself take care of available Application server.
If this doesn't help, try improving your program logic, STARTING NEW TASK may not help.
Regards,
Diwakar
05-26-2011 10:24 AM
Hi Diwakar,
try CALL FUNCTION func STARTING NEW TASK task1 DESTINATION dest IN GROUP DEFAULT, this will enable to run FM in groups (parallel processing) and might help in performance as will itself take care of available Application server.
Not true, you can call an FM(which needs to be RFC of course) just like below, and you would still achieve parallel processing, read IN GROUP for more details on when and where to use it.
DATA: l_task TYPE char10.
DO 5 TIMES.
l_task = sy-index.
CONDENSE l_task.
CONCATENATE 'TASK' l_task INTO l_task.
CALL FUNCTION 'ZTEST_CHEN' STARTING NEW TASK l_task.
ENDDO.
Regards,
Chen
Edited by: Chen K V on May 26, 2011 2:55 PM
06-03-2011 2:30 PM
you can run tasks many but see that you may not get any performance issue at runtime if your programme is module pool and than create an t.code for you won't get any issues
thanking you
06-03-2011 2:42 PM
Please enlighten me (us?), what does this have to do with module pool or t.code?
Thomas