Many a times in development, need to implement asynchronous parallel processing to speed up the execution but unfortunately we can not spread as many number of parallel threads in the program as we have a limited number of dialog work processes. So maximum parallel threads we can create that depends on the currently free/available work processes. So we can use the FM to get the free dialog work process at the run time.
---------------------------------------------------------------------------------------------------------------------------------
DATA : lv_max_dwp TYPE i,
             lv_free_dwp type i.

CALL FUNCTION 'SPBT_INITIALIZE'
* EXPORTING
*   GROUP_NAME                           = ' '
 IMPORTING
   max_pbt_wps                          =  lv_max_dwp
   free_pbt_wps                         =  lv_free_dwp
 EXCEPTIONS
   invalid_group_name                        = 1
   internal_error                                 = 2
   pbt_env_already_initialized            = 3
   currently_no_resources_avail         = 4
   no_pbt_resources_found                 = 5
   cant_init_different_pbt_groups       = 6
   OTHERS                                            = 7.

WRITE :/ 'Maximum Dialog Work Processes available in the server:', lv_max_dwp.
WRITE :/ 'Free Dialog Work Processs available in the server:', lv_free_dwp.



Serkan AKKAVAK
Computer Engineer
SAP Department Deputy Manager
Contact : serkurumsal@yandex.com