Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Job scheduling

Former Member
0 Likes
1,075

Dear Friends,

I hv a requirment in job scheduling.The scenario is that, Job needs to be scheduled for a program, which imports non-sap data and pushes that into sap.The situation is that if same file is processed again during scheduling then it should show a system error or the file which is being processed is incomplete, it should show system error as well.pls suggest how to accomplish this scenario.

Regards

Anand Gupta

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
964

I hope filename will be unique means file contains the time and date. You can create a custom table and udpate the filename once u process the program successfully. then check it in the start of the program whether you have processed the same file if so error otherwise continue.

6 REPLIES 6
Read only

Former Member
0 Likes
965

I hope filename will be unique means file contains the time and date. You can create a custom table and udpate the filename once u process the program successfully. then check it in the start of the program whether you have processed the same file if so error otherwise continue.

Read only

Former Member
0 Likes
964

Once jobs are defined, they are stored in the SAP database in the following principal tables in the background processing system:

TBTCO: The job header table (job management data)

TBTCP: The job step table (individual processing steps in jobs)

TBTCS: The control table for the time-driven job scheduler

BTCEVTJOB: Jobs scheduled to wait for an event

You can query on the above tables based on the status .

Hope ths helps

Read only

0 Likes
964

Hi,

Thanks for ur suggestion, Can u pls elaborate it a bit more, and is there any field in these tables that stores the filepath and filename.

Thanks in advance.

Regards

Anand

Read only

0 Likes
964

No there is no field as such in these tables one of the approach to do is

*All files will have a unique name i belive so now whenever you process a file update it in a custom table

and mark a flag X on it now suppose it happens you are processing the same file

you can actually check your custom table for file name and flag if its X then you can give a error message.

All you need to do is to create a custom table and write a logic to update the table with the filename'

hope this helps

Read only

0 Likes
964

Yes you can do so by updating a custom table on every successful file run.

--> You have to identify each file by its unique name, say for example you have a file with name as MM_01.txt.

--> Here 01 is considered as a counter, so on successful run of this file, update the custom table with a field called current run as 01.

--> The next file should have the name as MM_02.txt. So, before updating this file data in to SAP read the custom table for counter value.

--> If you don't have 02 as your counter value from custom table read, then proceed with processing data and update the custom table with counter value as 02, otherwise show an error by updating a custom error table.

--> Like this, you can update the counter value field in custom table for every successful processing of a file.

Read only

Former Member
0 Likes
964

Why dont you archive the file in AL11 once it is accessed by a program. So when a 2nd job tries to access the same file...it will be missing from the filepath as the file that 2nd job is looking would have been archived.

I am assuming you are reading the file from unix directory at tcode 'AL11'.

You cant schedule a job having a file at the presentation server.

if the jobs are always scheduled then you can make use of TBTCO tables alongwith few more job related tables.

But if the program is going to be executed by both online and background then it is good you maintain a custom table and log each

execution.

~Nanda