Application Development and Automation 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: 
Read only

How to get data using Timestamp

Former Member
0 Likes
3,151

Hi gurus ,

I am inserting the data in one table

in that onefield is timestamp.

in that i am concatenating sy-datum and sy-uzeit.

now i have to fetch the data using date .

How can i ..fetch the data..?

can anyone suggest me..?

i tried date*, and %date% also

still its not fetching the data..

Thanks & Regards

kalyan.

1 ACCEPTED SOLUTION
Read only

former_member233090
Active Contributor
0 Likes
1,617

Hi,


* Declaring the work variables.......................
DATA :
  timestamp like TZONREF-TSTAMPS,
  time      like sy-uzeit,
  date      like sy-datum.

* The following function module is used to convert the
* time and date into GMT timestamp

CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
  EXPORTING
    i_datlo           = sy-datum
    i_timlo           = sy-uzeit
    I_TZONE           = 'INDIA'
 IMPORTING
   E_TIMESTAMP       = timestamp.

* The following function module is used to convert the
* above obtained timestamp to PST time zone date and time.

CALL FUNCTION 'IB_CONVERT_FROM_TIMESTAMP'
  EXPORTING
    i_timestamp       = timestamp
    I_TZONE           = 'PST'
 IMPORTING
    E_DATLO           = date
    E_TIMLO           = time.

write :/ 'Date and Time at PST zone is ',date, time. 

7 REPLIES 7
Read only

agnihotro_sinha2
Active Contributor
0 Likes
1,617

Did you try Logical operators: CA (contains ANy) or similar things?

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,617

Also concatenate the the miimum time and maximum time to the date and select.

Hope you got the idea.

Read only

former_member206439
Contributor
0 Likes
1,617

Hi Kalyan,

Try useing below condition once.

In where condition directly put

Where

TIMESTAMP EQ SY-DATUM

SY-DATUM or you own date.

I tries the same and its working fine.

Thanks

Naresh

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,617

Use a range, fill it with range-low = date + '00:00:00', range-high = date + '23:59:59', and use a timestamp IN range in the WHERE option of the SELECT statement. (or a BETWEEN)

Regards,

Raymond

Read only

0 Likes
1,617

How do you select records from a table when the field on the tableis defined as timestamp and the select-options field is defined as sy-datum?

Read only

0 Likes
1,617

I'm also sorting this out. I think you need to use the command

 convert date sy-datum time sy-uzeit time into time stamp 'your field' time zone 'UTC' 

to make a field that is like the time stamp you want to select.

But I haven't been able to get any data as well so far.

Read only

former_member233090
Active Contributor
0 Likes
1,618

Hi,


* Declaring the work variables.......................
DATA :
  timestamp like TZONREF-TSTAMPS,
  time      like sy-uzeit,
  date      like sy-datum.

* The following function module is used to convert the
* time and date into GMT timestamp

CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
  EXPORTING
    i_datlo           = sy-datum
    i_timlo           = sy-uzeit
    I_TZONE           = 'INDIA'
 IMPORTING
   E_TIMESTAMP       = timestamp.

* The following function module is used to convert the
* above obtained timestamp to PST time zone date and time.

CALL FUNCTION 'IB_CONVERT_FROM_TIMESTAMP'
  EXPORTING
    i_timestamp       = timestamp
    I_TZONE           = 'PST'
 IMPORTING
    E_DATLO           = date
    E_TIMLO           = time.

write :/ 'Date and Time at PST zone is ',date, time.