‎2009 Sep 22 8:51 PM
Hi,
I have a requirement where my ABAP program should run multiple times a day and it should store the time of every run to be used in the next run of that day. What kind of a variable(data type) should be used and how?
Any suggestions will be awarded with points.
Regards,
Adarsh
‎2009 Sep 22 8:54 PM
Hi,
to Run the ABAP program Multiple times a day , Shedule the Job in Batch mode..
and all the shedule jobs are stored in TBTCO and TBTCP table with status..
Check the last run status of the job if it is fincished successfull then fetch the date and time of the job and use for next Run..
Prabhudas
‎2009 Sep 22 9:23 PM
Define a TVARVC parameter variable using transaction STVARV let us say LAST_RUN_TIME. Have a parameter on your selection screen for time. When you save your variant, in the attributes for this parameter, do the drop down under column "Selection Variable" and chose 'T' and then under the colument "Name of the variable " select the parameter that you just saved(LAST_RUN_TIME). Save your variant and use that variant for each of your runs during the day.
Now at an appropriate point in your code (typically when all the SELECTs are completed), store the time(SY-UZEIT) in a variable and update TVARVC where the name is LAST_RUN_TIME and set value equal to the variable value. Yes, you can update this table directly.
‎2009 Sep 23 4:35 AM
Hi,
How to store the time will also depend on, exactly which time is required Start time of job or ens time of job.
If start time is required , then you have to get the time in start of your report and you should store the same in some Z table.
Prefer to use the one you are already using in your report.
Also, if you are scheduling it as backgroung job you have to consider other factors like wating time i.e scheduled and start time can be different.
Check database table TBTCO and TBTCP for details.
Hope its help you.