Question:
Hi,
I need to identify through a program that this program is running in background or foreground.
Is there any table which maintains the currently running background programs or there is any other way to find this out.
Please help.
Regards,
Amber
Answer:
Hi,
I need to identify through a program that this program is running in background or foreground.
Is there any table which maintains the currently running background programs or there is any other way to find this out.
Please help.
Regards,
Amber
BETTER GO FOR TCODE SM37 (JOB OVERVIEW)
Answer:
are held in TBT* table series. You should be able to find the info you need in there.
Answer:
Use the function MODULE BP_FIND_JOB_WITH_PROGRAM (or something like that ).
_________________
Only sheep and Tuly Idiots need a leader
Answer:
If you want to check in a program if the current run is a background run or not, then you can see variables sy-batch and sy-binpt.
If the program is running in batch, you can get further info about the batch using FM GET_JOB_RUNTIME_INFO.
Hope this helps.
br.
Answer:
If this is a Z program then you can generate your own flag within a Z table and reset this flag on exit. Programs run in parallel can check for this flag and exit if set.
Otherwise, the problem is not in detecting background jobs, but foreground ones. Obviously transactions like SM50 (single server) or SM51 (Multiple server) does just this, so I would suggest looking into the programs behind these and using the same method.
Dr Sidewalk
_________________
"In the middle of difficulty lies opportunity" - Albert Einstein
"Money isn't everything in life, unless you don't have it". David King
"Fail to plan, plan to fail"
"Success is a journey, not a destination."
Answer:
If this is a Z program then you can generate your own flag within a Z table and reset this flag on exit. Programs run in parallel can check for this flag and exit if set.
I thought that's what TVARV was for (ducks for cover).
To the original poster, are you trying to discover if the program is itself running in batch, or if there are other instances of it running? It could be interpreted to mean either or both.
Answer:
FM 'BP_JOB_SELECT_SM37B' to know if your program is running in background. You can use FM 'ENQUEUE_E_DSVAS_TRDIR' and 'DEQUEUE_E_DSVAS_TRDIR' if your issue is to avoid running the same program twice at the same time.
Regards,
Remus.