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 know PID of background job at runtime?

Former Member
0 Kudos

Each background job has a unique Work Process ID (PID).

Is there a way to know the PID of a job at runtime, inside the ABAP program that is a step of that job?

Sy- varaibles dont seem to give the PID. Is there any Function module that will give PID at runtime?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Sudhir,

You can try using the FM 'TH_WP_DETAIL_INFO' which returns the pid value. You can use it as under:

CALL FUNCTION 'TH_WP_DETAIL_INFO'

EXPORTING

WP = 'XX'

WITH_CPU = '10'

WP_INDEX = '0'

IMPORTING

WPINFO = wpinfo.

WPINFO- WP_PID will contain the PID value of the current process. Do let me know if this works for you.

Regards,

Chetan.

PS: Reward points if this helps.

5 REPLIES 5

Former Member
0 Kudos

hi

good

go through these links, i hope these ll help you to give you more idea about the PID.

http://help.sap.com/saphelp_nw04s/helpdata/en/0b/6aedff404d6b4a8cac8f1359e1b47c/content.htm

thanks

mrutyun^

Former Member
0 Kudos

Hi Sudhir,

If you have the jobname, then you can query the table TBTCO with the same. This table contains couple of fields WPNUMBER(Work process number) & WPPROCID

(Work process ID).

Regards,

Chetan.

PS: Reward points if this helps.

Former Member
0 Kudos

Thanks for the replies.

I have a situation where more than one jobs of same name are running at the same time. Thats why I want to get the PID at runtime for the current job. Any suggestions?

Former Member
0 Kudos

Hi Sudhir,

You can try using the FM 'TH_WP_DETAIL_INFO' which returns the pid value. You can use it as under:

CALL FUNCTION 'TH_WP_DETAIL_INFO'

EXPORTING

WP = 'XX'

WITH_CPU = '10'

WP_INDEX = '0'

IMPORTING

WPINFO = wpinfo.

WPINFO- WP_PID will contain the PID value of the current process. Do let me know if this works for you.

Regards,

Chetan.

PS: Reward points if this helps.

Former Member

Thanks for the replies.

We used FM TH_GET_OWN_WP_NO to get PID.