Dear gurus,
I actually think I have a solution but thought it best to bounce it off the basis experts in case I missed anything or there is a ninja out there with a better idea.
Jobs in SAP AS ABAP can be scheduled with minimum interval of 60 seconds and after release it can take up to 60 seconds before the step program actually executes. This is too long for me because I need about 5 second intervals (I cannot change that) when users activate a mode to monitor them and collect some data about the application they are using during testing. After activation they could be doing anything in the system so I cannot run my code from their application (exit, etc).
So plan is to have a job which is scheduled every 10 minutes or so (configurable) and the program in the step keeps running for the 10 minutes and runs my monitor code every 5 seconds. After the 10 minutes it stops the monitor call, raises an event if anyone is still in monitoring mode (which is the event at which the periodic job starts again) and closes it's own job log. Latest at the next start of the monitoring mode via my application, the job is started again.
This means that the job and program is at least running permanently (and occupying a WP), but will rest if nothing is going on and write a job log and start over every 10 minutes or so.
This does the trick for me but still seems to be a bit too clever, so I am wondering whether there is a more elegant way of doing it. Perhaps a system exit somewhere in code which runs permanently (auto abap as SAPSYS has the downside that it cannot make any AUTHORITY-CHECKs..) or something from the OS?
Any thoughts, interesting discussion or ninja tricks will be highly appreciated.
Cheers,
Julius