Skip to Content
avatar image
Former Member

How to know PID of background job at runtime?

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 23, 2006 at 05: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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 23, 2006 at 04: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^

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 23, 2006 at 04: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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 23, 2006 at 04: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?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 23, 2006 at 09:01 AM

    Thanks for the replies.

    We used FM TH_GET_OWN_WP_NO to get PID.

    Add comment
    10|10000 characters needed characters exceeded