Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SM36 & SM37

Status
Not open for further replies.

BeechHill

Technical User
Jul 16, 2002
4
US
Can someone tell me how I would create an external command, which would allow me to delete repeat run background batch programs automatically.

Example create Job called New Plants AM
This job is scheduled/released to run each morning for 365 days/yr.

Therefore, in the Batch log there will be many Finished jobs, which will accumulate. Can a process be written which will use an external program since ABAP has none, which will delete a Batch Job by name for a specified range in dates.

Our front end runs in UNIX w/Oracle data base and Windows 2000 user base.

Thanks in advance

Geoff
 
Hi Geoff,

The problem you seem to have here is a poor understanding of how SAP periodic jobs work. Whereas in legacy systems you might have had to replicate the job as often as it runs this is not the case in SAP.
The job gets created once and has the replication information on it. When it gets release it checks this information and resubmits itself in scheduled(or released ?) status until the time comes to run again.

Basically what you would need to do in such a scenario is to modify the existing job to make sure it does not run after date one and copy it with a start date of date two.

This would mean that until the job interrupts its regular schedule it will appear twice in the schedule category.

Now as to your requirement I would try to create an ABAP that will use the function modules from job management to retrieve, copy and modify the relevant information.

However you might want to look into external job scheduling systems as SAP provides a standard interface for those.

Best of Luck
F.J. [yinyang]
 
FJ,

I thank you for your reply and or critism, but this is not the problem. I have created the jobs as a PM and AM run on a daily basis. The jobs automatically schedule, release and run just fine. But after each run I get a finished job. This is expected.

Am I to understand that I am missing something in my setup? All else has been working quite well. I have automated the whole CIF process ~75% and have written a number of programs to accomidate the same.

On the present project for ~1.5 years and in charge of 4 million materials and am in the process of compiling information for a book on the subject.

I listen to everyones input, as the holder of the keys of information is not the winner in the end. It is the one who shares the data. Pooly informed not.

Any further input would be greatly appreciated sarcasm and all. Thanks,

Geoff
 
Hi Geoff,
I'm not quite sure whether I understood what your problem is.
I think you are concerned about the lot of space required by logs of old jobs in your system (database), aren't you?
In our system this problem is solved by the job SAP_REORG_JOBS, running once every night. Among other things it deletes all jobs older then 20 days.
This job should exist in your system as well. So have a look, and schedule/release it.
Hope this helps, regards.
 
Thank you all for you replies. I have located the ABAP job which we now run at night to clear out old logs.

Thanks again for your Help.

Geoff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top