11-23-2006 4:07 AM
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?
11-23-2006 5:02 AM
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.
11-23-2006 4:20 AM
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^
11-23-2006 4:32 AM
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.
11-23-2006 4:46 AM
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?
11-23-2006 5:02 AM
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.
11-23-2006 9:01 AM