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: 

How to find out number of background work processe available in the system?

Former Member
0 Kudos

Hi All,

I have a FM that triggers a background job using JOB_OPEN, ABAP_SUBMIT and JOB_CLOSE. But the problem is if there are no background work processes available at that moment, it does not return error. Not sure whether the job is even scheduled!

Is there a way to find out if there are any background work processes available in the system? I know a FM SPBT_INITIALIZE which gives info about dialog work processes. Is there any other FM similar to this which gives info about background wp??

Regards,

Shailesh

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos

Check the fm TH_DISPLAY_WORKPROCESS_LIST without providing any input , there is a routine SET_LIST_WPLST which fetches the data . In the output the type BGD indicates the background work process.

7 REPLIES 7

surajarafath
Contributor
0 Kudos

You can use the table TBTCO Status to determine the status of the Job.

0 Kudos

@playsuji - Knowing the status of the job isn't the problem at all!

Edited by: Shailesh Tukaram Ingale on Dec 12, 2011 7:20 AM

kesavadas_thekkillath
Active Contributor
0 Kudos

Check the fm TH_DISPLAY_WORKPROCESS_LIST without providing any input , there is a routine SET_LIST_WPLST which fetches the data . In the output the type BGD indicates the background work process.

Former Member
0 Kudos

your Job will remain in a queue by message handler. once workprocess is free, your job gets scheduled

by the way, you can use the functionality used in FM TH_DISPLAY_WORKPROCESS_LIST to read the workprocesses

the command which gets you the workprocess is:

CALL 'ThWpInfo' ID 'OPCODE' FIELD OPCODE_WP_LIST
                  ID 'TAB' FIELD LIST_STATE_WPLST-TABL
                  ID 'CPU' FIELD LIST_STATE_WPLST-CPU.

check how its written in include LSDEBF01, form SET_LIST_WPLST

Edited by: Soumyaprakash Mishra on Dec 12, 2011 12:17 PM

0 Kudos

Hi Soumya,

Your answer was helpful. However i could not locate the FM in my system(!).

Anyway i debugged the transaction sm50 and found the relevant code.

Following snippet worked for me -

DATA :

opcode_wp_get_info(1) TYPE x VALUE 25,

num_btc_wps TYPE i,

num_free_btc_wps TYPE i.

CALL 'ThWpInfo'

ID 'OPCODE' FIELD opcode_wp_get_info

ID 'BTCWP' FIELD num_btc_wps

ID 'FREE_BTCWP' FIELD num_free_btc_wps.

Thanks & Regards,

Shailesh

0 Kudos

Hi,

You should not write this statement in your custom code because these are internal commands. In documentation its mentioned that

This statement is for internal use only.Incompatible changes or further developments may occur at any time without warning or notice.

SAP provides the released function module which uses this statements and can be used by the customer.

I donot find a released function module and i hope that the function TH_WPINFO exists in your system.

0 Kudos

Thanks Keshav. I found FM TH_COUNT_WPS which does exactly what i need.