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: 

Calling function in NEW TASK

Former Member
0 Kudos

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

7 REPLIES 7

Former Member
0 Kudos

I think the no of tasks is restricted to 6. Refer sap help.

Former Member
0 Kudos

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

ThomasZloch
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

Please enlighten me (us?), what does this have to do with module pool or t.code?

Thomas