Scheduling jobs as per your requirement is quite important and difficult task in BODS.
However, now you can do this task, as per your preference.
You can create a schedule of jobs, which will execute jobs one after another, i.e. event based sequential scheduler in BODS 🙂
Step 1 –
You need ‘Execution command file’ for all the jobs, you want to schedule. If your are already aware of how to create same, you can go to step 2 directly.
a) Others, Follow the steps as per below document, to get a batch file for each BODS Job-
Step 2 –
- You should get one batch file (for windows), e.g. job_name.bat.
This file is created to SAP BODS installtion folder. But if you give your own path it will be created on your specified path.
You might not find this file, as folder is hidden sometimes. You can search the file by making all folders visible.
2. Try to execute this file directly from command prompt.
3. Make sure this batch file is running as expected, in command prompt.
4. If not, then cut/paste this batch file to other location & try running.
Eg. Type E:\SAP\JOB_NAME.BAT & press enter.
Step 3 –
Once file is executed on command prompt, we can create our own scheduler in bods designer.
1. Create a new job & new script.
2. Type in script –
Exec( ‘cmd.exe’ , ‘E:\\SAP\\JOB_1.BAT’, 8) ; #Standard command
Print( ‘ Job_1 Completed….’) ; #Print the status of commad to log file
Exec( ‘Batch_file_Path\\JOB_2.BAT’ , ” , 8) ; # cmd.exe is optional, as batch files are executables
Print( ‘ Job_2 Completed….’) ;
print ( Exec(‘cmd.exe’, ‘Batch_file_Path\\JOB_3.BAT’, 8) ) ; # You can print the status of job execution directly.
& So on…………..
(Just take care of escape caracters while giving the file path, as per your operating system)
3. Save script/job.
Your custom scheduler for many jobs is ready.
This will execute your jobs as per sequence you decide.
You can extend this technique to execute many jobs parallely by adding many scripts/workflow combination.
If you know python/MS DOS batch commands/shell scripts, you can do multiple tasks with this scheduling technique.