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

Call Function STARTING NEW TASK ----- Resource not available

former_member195698
Active Contributor
0 Likes
1,407

Hi All,

I am calling a Function Module in new task using STARTING NEW TASK.

If the resources are not available for the Dialog Process to start, for how long will SAP keep on trying to acquire the resources and in case if it fails to acquire resource, then what will happen

Regards,

Abhishek

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,145

Hi,

From memory (as it is a long time since I've done this) you can call another function module or SAP command that will tell you how many work processes are currently available before you actually then start the new task. This can help you to avoid this issue and also stop you from eating up all available work processes on a system which will annoy all other users!

I think this is the FM

CALL FUNCTION 'SPBT_INITIALIZE'
  EXPORTING
    group_name     = 'parallel_generators'
  IMPORTING
    free_pbt_wps   = w_free_processes
  EXCEPTIONS
    OTHERS         = 1.

Gareth.

4 REPLIES 4
Read only

Former Member
0 Likes
1,146

Hi,

From memory (as it is a long time since I've done this) you can call another function module or SAP command that will tell you how many work processes are currently available before you actually then start the new task. This can help you to avoid this issue and also stop you from eating up all available work processes on a system which will annoy all other users!

I think this is the FM

CALL FUNCTION 'SPBT_INITIALIZE'
  EXPORTING
    group_name     = 'parallel_generators'
  IMPORTING
    free_pbt_wps   = w_free_processes
  EXCEPTIONS
    OTHERS         = 1.

Gareth.

Read only

0 Likes
1,145

Hi,

I want to know "how long will SAP keep on trying to acquire the resources and in case if it fails to acquire resource, then what will happen".

I have to call the FM and its not optional (even if there are no resources available).

Regards,

Aj

Read only

0 Likes
1,145

Does it sit in a loop trying to get the resource? Because if not, there is no point calling it if there are no resources available.

Would it not be better to put your code into a loop so that it keeps checking to see if resources are available and when they, are grabs them, else loops again and checks for resource etc... At least that way you have some control and can also help to not use up all available work processes which, as I suggested, will only annoy other users of the system.

Gareth.

Read only

former_member195698
Active Contributor
0 Likes
1,145

Used - In background task instead of starting new task