Application Development 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: 

Need to fetch updated records by Back ground scheduling

Former Member
0 Kudos

Hi,

I have a report program which fetches the employee details. I have created a back ground job for this report program. When the job executes for the first time it should fetch all the records. But when the job executes for the second time and so on it should retrieve only the updated records.

I will explain in detail.

Suppose I execute the job today for the first time , it should retrieve all the employee records . But tomorrow if the job executes, it should retrieve those records that are inserted or changed in these 24 hrs of time.

Could any body tell me the necessary programming logic.

Reward points are assured.

Best regards

Bhagat.

3 REPLIES 3

Former Member
0 Kudos

Hi ,

Use CDHDR AND CDPOS tables or function module with

CHANGEDOCUMENT_READ_HEADERS

CHANGEDOCUMENT_READ_POSITIONS

Based on object ,date and time .

For eg .Object defined in transaction SCDO .

Please reward if useful.

Former Member
0 Kudos

Hi Bhagat,

make an Input-field f. example P_ALL as checkbox.

create to variants first P_ALL = 'X', second P_ALL = space.

Create a job with variant A wich runs only one time.

create a job with variant B which runs every day.

In the Report hande P_ALL as you want.

Hope it Helps.

Regards, Dieter

Former Member
0 Kudos

Hi bhagat,

As u have said store all the entries in an internal table that are executed on the current day, then store the entries into another itab that are retreived when executed on the other day.

Now compare the itabs and delete the entries which are similar from the second iatb based on some unique key field to obtain the newly added entries.

pls reward points if helpful.