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

maintaining program last run date

Former Member
0 Likes
1,585

Hi Experts,

The program will be run on a daily basis. To avoid duplication of data the extract should store the last run date. Every time it runs it should check the last run date and return only records subsequent to that run date. Can anyone please give the solution.

Regards,

venkatesh

1 ACCEPTED SOLUTION
Read only

h_senden2
Active Contributor
0 Likes
1,005

what you can do is add a record to the TVARV table with the last run date of the program.

At the beginning of the program you check this record.

At the end you have to update this record with the current date.

regards,

hans

6 REPLIES 6
Read only

h_senden2
Active Contributor
0 Likes
1,006

what you can do is add a record to the TVARV table with the last run date of the program.

At the beginning of the program you check this record.

At the end you have to update this record with the current date.

regards,

hans

Read only

Former Member
0 Likes
1,005

Since the job runs daily only once. When you extract the data use sy-datum to extact the data.

If it runs more than once, then create a table to store the program name , last run date and last run time.

regards,

Advait

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,005

Create a Z table and do that.

Read only

Former Member
0 Likes
1,005

Dear Venkatesh,

You need to create custom table for the same.Wherein you will be storing the date and time,at the end of your program.At the start of your program ,you can select the record with max date and time from this table.This way scenario can be easily handled.

Hope it helps you.

Read only

Former Member
0 Likes
1,005

Dear Venkates,

u can do this by maintaining the last run date in some ztable

ztimestamp

when u execute the program check whether ur current date is greater thna the value stored in the ztimestamp.

but remember u nedd to use locking mechanism for this

after the execution update the Ztimestamp with the current value

use the enqueu and deque functionality

u need to do this to avoid simultameous update to ur timestamp.

hope it solves ur problem.

thanks sushant

Read only

Former Member
0 Likes
1,005

Hi,

Thanks for your valuable solution.

regards,

venkatesh