2021 Nov 25 5:03 AM
Hi All,
I am fetching data from VLCHISTORY table ,
in which data has to be selected for todays date , for that TSTMP field has to be used,
and on ABAP report selection screen i have parameter field type of DATUM.
how datum field can be used with TSTMP field for data retrieval.
Please share the solution.
Thanks
Vikash
2021 Nov 25 11:59 AM
Just convert the date into two timestamps (at 00:00:00 and 23:59:59) select with database timestamp field between those values?
CONVERT DATE p_date TIME '000000'
INTO TIME STAMP low_timestamp
TIME ZONE sy-zonlo.
CONVERT DATE p_date TIME '235959'
INTO TIME STAMP high_timestamp
TIME ZONE sy-zonlo.
SELECT COUNT(*) FROM vlchistory
WHERE tstmp BETWEEN low_timestamp AND high_timestamp.<br>
Hi All,
I am fetching data from VLCHISTORY table ,
in which data has to be selected for todays date , for that TSTMP field has to be used,
and on ABAP report selection screen i have parameter field type of DATUM.
how datum field can be used with TSTMP field for data retrieval.
Please share the solution.
Thanks
Vikash
2021 Nov 25 5:29 AM
2021 Nov 25 5:49 AM
Hi,
In this thread , at first data is being selected from DB table and then data is being deleted from internal table,
i have to filter data while selecting it from DB table itself. otherwise it will return all the record .
Thanks
2021 Nov 25 5:54 AM
Please check the second answer thread in the link:
https://answers.sap.com/questions/8079633/select-query-on-time-stamp.html
2021 Nov 26 4:59 AM
2021 Nov 25 11:59 AM
Just convert the date into two timestamps (at 00:00:00 and 23:59:59) select with database timestamp field between those values?
CONVERT DATE p_date TIME '000000'
INTO TIME STAMP low_timestamp
TIME ZONE sy-zonlo.
CONVERT DATE p_date TIME '235959'
INTO TIME STAMP high_timestamp
TIME ZONE sy-zonlo.
SELECT COUNT(*) FROM vlchistory
WHERE tstmp BETWEEN low_timestamp AND high_timestamp.<br>
2021 Nov 26 6:52 AM
2021 Nov 25 3:18 PM
You need to make sure of the time zone of values in VLCHISTORY-TSTMP. Usually it's UTC.
Usually, people will enter the date for their local time zone, so you should convert from user's time zone to VLCHISTORY-TSTMP time zone.
See Raymond answer for more details.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |