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

Timestamp

Former Member
0 Likes
802

hi,

i have to select data according to the date and time from a z-table,there are no date and time fields in that z-table,i have no idea about timestamp,can i use that one ?if yes then how can i use it?

1 ACCEPTED SOLUTION
Read only

SumanPoddar
Active Participant
0 Likes
668

hi,

No you can't as you don't have the date and time in Ztable, Can't select from the table using date & time.

First you need date and time in the Ztable.

Regds.

Suman

5 REPLIES 5
Read only

SumanPoddar
Active Participant
0 Likes
669

hi,

No you can't as you don't have the date and time in Ztable, Can't select from the table using date & time.

First you need date and time in the Ztable.

Regds.

Suman

Read only

0 Likes
668

so,can i add timestamp field in my table?

Read only

Former Member
0 Likes
668

Hi,

If it is a Z table then you can add two fields say for e.g.

ZZDATE of component type SYDATUM,

ZZTIME of component type SYUZEIT.

So each time through any program when you will insert some data or update the table just pass SY-DATUM to ZZDATE and SY-UZEIT to ZZTIME.

So, each update or insertion of data will have the time stamp with it.

I hope this will help you out.

Read only

Former Member
0 Likes
668

Hi Priya,

In your Z Table

Insert two more fields called

ZDATE of data type DATS and

ZTIME of data type TIMS

Now in your Z programs which r inserting/updating this Z Tables...

in insert or update statement include these 2 fileds as well ZDATE and ZTIME...

u can get the current system time at runtime from variable sy-uzeit and current system date from variable sy-datum.

Now in ur Final Z report where u wanna give the date and time in selection screen ... write the select condittion with keeping ZDATE and ZTIME fields in where condition...

Hope it will solve your problem..

Reward points if useful..

Thanks & Regards

ilesh 24x7

Read only

Former Member
0 Likes
668

Create two fields in the Ztable

field1 as type sy-datum and field2 as sy-uzeit.

Then during the first execution extract all the data you want based on the data and time from the ztable. for the first execution all the data till date will be coming, because the ztable values are blank. So after first execution update Ztable with current execution time and date.

From next execution onwards, read the date and time from Ztable and use it for ur selection.