01-03-2014 7:47 AM
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
01-06-2014 5:43 AM
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
01-03-2014 8:21 AM
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
01-03-2014 8:41 AM
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
01-03-2014 8:58 AM
Hi,
Can you check the note Note 900837 - No DB data in work process detail display
01-03-2014 10:09 AM
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
01-03-2014 10:28 AM
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.
01-03-2014 10:39 AM
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
.
01-03-2014 10:41 AM
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.
01-03-2014 10:48 AM
Hi Santhosini,
Please use below function module.
TH_WPINFO.
Here, you dont want enter, even single value.
Arivazhagan S
01-04-2014 3:25 PM
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
01-04-2014 3:42 PM
Hi Arivazhagan..
This FM gives me the list of all existing processes.
Not my current PID
01-04-2014 3:50 PM
Hi Santhosini,
After getting all pid's pass program name as sy-repid.
Then you will get PID for your current program.
Arivazhagan S
01-05-2014 9:11 AM
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.
01-06-2014 5:43 AM
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
01-06-2014 6:38 AM
Hi Santhosini,
please use FM "TH_GET_OWN_WP_NO", it will solve your purpose.
--
Regards-
Gagan Kumar
01-06-2014 7:34 AM