2010 Jul 06 10:50 AM
Hello Experts,
i have a requirement the i need to capture select query start time and date as i runthe program on midnight (ie) 11:55 p.m.
I tried system fields sy-datum and sy-uzeit for capturing the system date and time when my program runs but it gets reset when the date changes.
i tried get time field option but it is resetting the sy-datum to zero so i am able to capture the date of the next day and resulting in wrong calculation of time .
please help with your valuable answers.
Thank you,
Srinivas.
Hello Experts,
i have a requirement the i need to capture select query start time and date as i runthe program on midnight (ie) 11:55 p.m.
I tried system fields sy-datum and sy-uzeit for capturing the system date and time when my program runs but it gets reset when the date changes.
i tried get time field option but it is resetting the sy-datum to zero so i am able to capture the date of the next day and resulting in wrong calculation of time .
please help with your valuable answers.
Thank you,
Srinivas.
2010 Jul 06 11:20 AM
Hi,
As per my understanding you want to fetch those data which are created between the program last run date time and current date time.
If I am right please follow the below procedure.
1. Create one custom table to store program name and program execution last date time
2. at event INITIALIZATION populate to fields date and Time using the statement sy-datum
initialization.
v_curr_time = sy-uzeit. " Current time
v_curr_date = sy-datum. " Current date
3. Get the last run date and time from the above custom table.
4. Do your logic.
5. at last Update the custom table with current date and time based on the step two (Here do not take sy-datum like that, take the value in the global variable populated in step 2)
Thanks
Subhankar
2010 Jul 06 11:26 AM
Hello Subhankar,
My intention is to capture the select query start date and time and end date and time and need those results in ztable.
As i have taken the sy-datum and sy-uzeit in global variables only.
i have 4 select queiries in my program i need to capture the time and date for all those queries.
if i scheduled this program at noght 11:55p.m then the time is getting resetting.
Thank you
srinivas
2010 Jul 06 11:36 AM
Hi,
You can do it very easily. Instead of date and time separately use timestamp. Take one numc 14 field or standard timestamp fild (TIMESTAMP). Put the start date and time before selecting in one variable and put end date time into another variable.
Now you can calculate the same (end timestamp - start timestamp).
Thanks
Subhankar
2010 Jul 06 12:26 PM
Hello Subhankar,
Can u please ellaborate your solution.
thank you
srinivas
2010 Jul 06 12:56 PM
Srinivas, I don't know what you did, but SY-DATUM is never reset by SAP to zero, so it must be your custom code which does something wrong. If it happens, then you should contact SAP support instead of posting in SDN.
sandra
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |