2009 May 13 1:31 PM
Hi ,
My requirement is basically to get the current jobname when the job is running in the background.
I tried using the FM 'GET_JOB_RUNTIME_INFO' but it always returns with exception NO_RUNTIME_INFO.
Can some one provide some answer for this.
Thanks in advance.
Regards,
Vijay
2009 May 13 1:35 PM
Hi,
allthe job names and information is stored in table..
TBTCO,TBTCP.
if you want to know the jon name..
if sy-batch = 'X' "that means job is running in back ground.
fecth the job name .
select sigle * from tbtco where INTREPORT = 'reportname which you are running'.
from above you get the job name related to program you are running.
regards,
Prabhduas
Hi ,
My requirement is basically to get the current jobname when the job is running in the background.
I tried using the FM 'GET_JOB_RUNTIME_INFO' but it always returns with exception NO_RUNTIME_INFO.
Can some one provide some answer for this.
Thanks in advance.
Regards,
Vijay
2009 May 13 1:35 PM
Hi,
allthe job names and information is stored in table..
TBTCO,TBTCP.
if you want to know the jon name..
if sy-batch = 'X' "that means job is running in back ground.
fecth the job name .
select sigle * from tbtco where INTREPORT = 'reportname which you are running'.
from above you get the job name related to program you are running.
regards,
Prabhduas
2009 May 13 1:54 PM
Hi ,
Thanks for the reply.
But the problem is
Say for example.
I am using a variant called Ztest .
Now i scheduled two jobs ZJ1 and ZJ2 using the same variant.
Now there is a problem in finding the current jobname.
2009 May 13 1:56 PM
Hello,
How do you know there is a problem? Try to debug the "finished job" & check why you are getting this error?
BR,
Suhas
2009 May 13 2:01 PM
Hi ,
I am not sure which problem are you referring to.
I used this FM
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
EVENTID =
EVENTPARM =
EXTERNAL_PROGRAM_ACTIVE =
JOBCOUNT =
JOBNAME = w_jobname
STEPCOUNT =
EXCEPTIONS
NO_RUNTIME_INFO = 1
OTHERS = 2
here i am trying to get the jobname in w_jobname.
2009 May 13 2:14 PM
Hello,
But as per your post you are always getting the EXCEPTION: NO_RUNTIME_INFO, when you are executing the 'GET_JOB_RUNTIME_INFO'.
How are you testing the program? Plz revert back.
If you are trying to run the program in the online mode, you will always get this EXCEPTION.
BR,
Suhas
2009 May 13 2:15 PM
Try BP_FIND_JOBS_WITH_PROGRAM, or others in same Function group.
2009 May 13 2:17 PM
Inside the Function Module GET_JOB_RUNTIME_INFO , there is call made for
CALL 'GetRuntimeInfo'
ID 'JOB' FIELD I_JOBINFO.
This is failing here.
2009 May 13 2:18 PM
I am running the program in background job and debugging by JDBG in background.
2009 May 13 2:27 PM
Hello,
The FM "GET_JOB_RUNTIME_INFO" will not work in DEBUG mode, because the stmt where the FM fails is an SAP Kernel call.
Hope this helps.
BR,
Suhas
Edited by: Suhas Saha on May 13, 2009 3:29 PM
2009 May 13 2:41 PM
Hi ,
Thanks for your answer.Can you please tell me how to debug the same without JDBG.
Regards,
Vijay
2009 May 13 2:42 PM
Sorry for the previous post, Please ignore the same.i didnt see your reply.
But one question is , how can i test the same.
BR
Vijay
2009 May 13 2:55 PM
Hello Vijay,
You donot EXPORT any data to the FM, you just IMPORT data from it.
I think that this FM is fool-proof )
AFAIK there is no way to test this FM.
BR,
Suhas
2009 May 13 1:39 PM
TBTC is the master table which stores information about the job.
2009 May 13 3:15 PM
Perhaps the problem lies in the definition of the variable. I tried this little test and it gets the job name cleanly.
Use SM36 to create this job and run it, and then go to sm37 and capture the active job. This brings up the debuger, and there you can see you are trapped in the endless WHILE. Just look at the content of the NAME variable and you'll see the name of the job. To exit, change the content of the CONTROL variable to anything other than 'X', and then exit debugging. If the job doesn't appear to stop in SM37, refresh it a pair of times and you'll see it as finished.
This is how you test this kind of functions or debug background programs.
DATA: name LIKE tbtcm-jobname,
control TYPE c.
control = 'X'.
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
* EVENTID =
* EVENTPARM =
* EXTERNAL_PROGRAM_ACTIVE =
* JOBCOUNT =
jobname = name
* STEPCOUNT =
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
WHILE control = 'X'.
ENDWHILE.
2009 May 13 3:25 PM
Hi ,
My Problem is solved now :)I had used the FM BP_FIND_JOBS_WITH_PROGRAM.
Thanks for all the responses.
Regards,
Vijay
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |