Gyan Factory

Gyan Factory
SAP Technical Project Support

Tuesday, January 5, 2016

Function Module that provides number of available Dialog Work Process in system?

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. 


---------------------------------------------------------------------------------------------------------------------------------









No comments:

Post a Comment