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 use 'TH_WP_DETAIL_INFO'

Former Member
0 Kudos

Hi all,

How do we use this FM 'TH_WP_DETAIL_INFO' to get the PID of the current program?

when I execute like this

CALL FUNCTION 'TH_WP_DETAIL_INFO'
EXPORTING
    WP                           = 'XX'
    WITH_CPU                = '10'
    WP_INDEX                = '0'
  IMPORTING
    WPINFO                       = wpinfo.


I am always getting the first PID in stack.


Please help me

Thanks in advance.

Santhosini

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Dear All..

Thank you for the suggestions.

1.I tried TH_WPINFO inside a small report . But the FM failed to return me the current PID even after passing the report name in WP_REPORT

2. same with RZL_SYSTEMWIDE_WPINFO

when I executed SM50 I was able to see my report running . But the entry is not showing up when i view the list inside my program.

And the Major issue why i needed the PID is,

The same program calls the BADI in multiple sessions. The BADI needs to be switched OFF/ON based on the user decision for each individual execution.

We had problems when we used a static variable.

Now we are using ABAP memory

Still we require a unique number that  can identify my individual execution and sustain the BADI

Say I use GUID_CREATE , and generate a GUID in my calling program , the same guid can not be generated in the BADI.

Any Random number generation , number ranges would fail in this case.

Reading the WP_LIST with WP_REPORT l is ambiguous as well.

any thing out of the box in this case is definitely  what I am looking at 

Thanks in advance,

Santhosini

15 REPLIES 15

arivazhagan_sivasamy
Active Contributor
0 Kudos

Hi Santhosini,

Please pass the wp_index as 1, 2, 3... etc.

Based on the above number it fetches the pid value.

Run the function module and check with sm50.

Arivazhagan S

former_member187748
Active Contributor
0 Kudos

Hi Santhosini,

for taking values from any FM, you have to pass correct parameters onto it.

Please see this link for all the possible parameters

SAP Function TH_WP_DETAIL_INFO - Determine detailed information on a work process

Former Member
0 Kudos

Hi,

Can you check the note Note 900837 - No DB data in work process detail display

Former Member
0 Kudos

Thanks for the replies...

My requirement is still not met..

I want to run this FM in my program and get the PID of the current process.. Is this possible?

What I found here is , we need to pass the work index number to fetch the respective PID

In my case i do not know the work Index number

0 Kudos

Hi Santhosini,

please do as sujjested and see, please do not pass anything in parameters

of TH_WP_DETAIL_INFO, and use it.

In export parameters please see the field WPINFO-WP_PID   contains the present process id or not.

0 Kudos

Hi Santhosini,

sorry for my previous post, i was not able to understand your problem

please see this , and use it, it would not give you any error.

and see what are you getting in wpinfo.

CALL FUNCTION 'TH_WP_DETAIL_INFO'

EXPORTING

   WP                           = 'XX'

   WITH_CPU                     = '10'

   WP_INDEX                     = '0'

IMPORTING

   WPINFO                       = wpinfo

  •   DIAREC                       =
  • EXCEPTIONS
  •   TH_BAD_PARAMTER_LENGTH       = 1
  •   TH_NO_PARAMETER              = 2
  •   TH_BAD_PARAMETER_VALUE       = 3
  •   TH_LIST_ERROR                = 4
  •   TH_INTERNAL_ERROR            = 5
  •   OTHERS                       = 6

          .

0 Kudos

Hi,

Check the usage of FM in any one of the below reports to get the PID information of current work processes!

Check the piece of code in program RSSM_SM50_ALT to get the current program PID

form wp_detail_list.
   clear tcode.
   listtype = 2.
   set pf-status 'DETAIL'.
   set titlebar '101'.

   call function 'TH_WP_DETAIL_INFO'
     exporting
       wp     = wp_no
     importing
       wpinfo = loc_wpinfo
       diarec = diarec.

   if sy-xcode = 'DEBU'.
     call function 'TH_DEBUG_WP'
       exporting
         wp_no                 = wp_no
       exceptions
         no_authority          = 1
         no_debugging_possible = 2.
   endif.

   clear wp_tabl.
   wp_tabl = loc_wpinfo.

   detail.
   perform wp_detail_info_out using wp_tabl diarec.

0 Kudos

Hi Santhosini,

Please use below function module.

TH_WPINFO.

Here, you dont want enter, even single value.

Arivazhagan S

0 Kudos

Hi Sanjeev,

Thanks for your response..

I executed this one.. I m always getting the WPINFO of the first process in the stack.

I am not able to get my current main program's process ID

0 Kudos

Hi Arivazhagan..

This FM gives me the list of all existing processes.

Not my current PID

0 Kudos

Hi Santhosini,

After getting all pid's pass program name as sy-repid.

Then you will get PID for your current program.

Arivazhagan S

0 Kudos

Hi Sanhosini,

1. First you have to get the sever name!

2. Then get the work process list on the server

3. Get the PID of the current program

CALL FUNCTION RZL_SYSTEMWIDE_WPINFO

It will retrieve the system/server wide work process

READ TABLE WPLIST WITH KEY WP_REPORT = SY-CPROG

IF SY-SUBRC = 0.

WPLIST-WP_PID  - get the PID

ENDIF.

Former Member
0 Kudos

Dear All..

Thank you for the suggestions.

1.I tried TH_WPINFO inside a small report . But the FM failed to return me the current PID even after passing the report name in WP_REPORT

2. same with RZL_SYSTEMWIDE_WPINFO

when I executed SM50 I was able to see my report running . But the entry is not showing up when i view the list inside my program.

And the Major issue why i needed the PID is,

The same program calls the BADI in multiple sessions. The BADI needs to be switched OFF/ON based on the user decision for each individual execution.

We had problems when we used a static variable.

Now we are using ABAP memory

Still we require a unique number that  can identify my individual execution and sustain the BADI

Say I use GUID_CREATE , and generate a GUID in my calling program , the same guid can not be generated in the BADI.

Any Random number generation , number ranges would fail in this case.

Reading the WP_LIST with WP_REPORT l is ambiguous as well.

any thing out of the box in this case is definitely  what I am looking at 

Thanks in advance,

Santhosini

0 Kudos

Hi Santhosini,

please use FM "TH_GET_OWN_WP_NO", it will solve your purpose.

--

Regards-

Gagan Kumar

0 Kudos

Thanks Gagan..

This is exactly what I was searching for