2005 Aug 23 2:04 PM
Hello,
I would like to know if there exists a way to find out the name of the background job where your ABAP program is currenctly running in.
Does there exist a function that I can call ?
Best Regards,
Erwin
2005 Aug 23 2:10 PM
You can get the job for a particular ABAP program by going to SM37 and give the program name in the 'ABAP Program Name' field and press execute.
Hello,
I would like to know if there exists a way to find out the name of the background job where your ABAP program is currenctly running in.
Does there exist a function that I can call ?
Best Regards,
Erwin
2005 Aug 23 2:10 PM
You can get the job for a particular ABAP program by going to SM37 and give the program name in the 'ABAP Program Name' field and press execute.
2005 Aug 23 2:18 PM
2005 Aug 23 2:31 PM
I agree with Rich. I use the same function module and works very well.
call function 'GET_JOB_RUNTIME_INFO'
importing
* EVENTID =
* EVENTPARM =
* EXTERNAL_PROGRAM_ACTIVE =
* JOBCOUNT =
jobname = jobname
* STEPCOUNT =
exceptions
no_runtime_info = 1
others = 2
.
Regards,
Subramanian V.
2005 Aug 23 2:16 PM
Hi,
try that :
fm SUBST_GET_JOBSTATE
and fm SLW_WL1_GET_BTCH_JOB_STATUS
(->status F = ready)
Andreas
2005 Aug 23 2:19 PM
2005 Aug 23 2:21 PM
Hi Erwin
I think that you can catch the name of back-ground job that your ABAP program is currently running, using system fields. (system fields example: sy-subrc)
While debugging, just see the fields in structure 'SY'. To know more about the system variables and which one may be suitable for your purpose, please check the link below:
http://www.planetsap.com/Abap_System%20fields.htm
SY-BATZO may be of your interest, check others too.
Cheers
Ashish Jain
2005 Aug 23 2:43 PM
Hi,
Thank you very much.
I'll try these functions, that's just what I needed
Best regards,
Erwin
2005 Aug 23 2:45 PM
Hi,
You can get the current backgroun job name for the given program name by joining the table TBTCP & TBTCO.
Here is the sample query to get the current job name for the give program name.
SELECT tstepjobcount tstepjobname tjob~status INTO CORRESPONDING
FIELDS OF TABLE joblist
FROM tbtcp AS tstep INNER JOIN tbtco AS tjob
ON tjobjobcount = tstepjobcount AND
tjobjobname = tstepjobname AND
tjob~status EQ 'R'
WHERE progname = your program name.
Hope this one will help u.
Best Regards,
Vijay