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: 

Parallel Processing - Rechecking number of available resources.

Former Member
0 Kudos

Hi SAP Gurus,

Anyone got an idea on how to determine the number of available resources when using parallel processing / multithreading approach to optimize a program? I was able to determine number of free resources by calling fm SPBT_INITIALIZE but wasn't able to perform another similar call to this fm (exception PBT_ENV_ALREADY_INITIALIZED is being triggered) for the purpose of rechecking the current available resources that I may use from time to time. Any idea?

Thanks,

Allex

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

insert after INITIALIZE:

case sy-subrc.
    when 0. "ok
    when 3.
      call function 'SPBT_GET_CURR_RESOURCE_INFO'
       importing
*   MAX_PBT_WPS                       =
         free_pbt_wps                      = gv_maxno_pbt_available
 exceptions
         internal_error                    = 1
         pbt_env_not_initialized_yet       = 2
         others                            = 3.

  when others.
   "...
  endcase.

kind regards,

hp

2 REPLIES 2

Former Member
0 Kudos

Hi,

insert after INITIALIZE:

case sy-subrc.
    when 0. "ok
    when 3.
      call function 'SPBT_GET_CURR_RESOURCE_INFO'
       importing
*   MAX_PBT_WPS                       =
         free_pbt_wps                      = gv_maxno_pbt_available
 exceptions
         internal_error                    = 1
         pbt_env_not_initialized_yet       = 2
         others                            = 3.

  when others.
   "...
  endcase.

kind regards,

hp

Former Member
0 Kudos

Thanks! This is just what Im looking for. Just in Time.