01-29-2007 11:52 AM
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.
01-29-2007 11:58 AM
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.
01-29-2007 12:03 PM
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
01-29-2007 12:09 PM
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.