‎2006 Jul 06 4:01 PM
hi guys ,
i am trying to get the sy-datum stored in oracle database and compare it with current date and set a flag .
i am trying to do some thing like this and it does not work. please help.
systemdate type sy-datum,
currenttime type sy-datum.
systemdate = geting from select * table ..
currentdate = sy-datum.
if systemdate = currrentdate.
enable = 'y'.
endif.
‎2006 Jul 06 4:12 PM
Hi ,
i am storing sy-datum in database table along with bunch of other fields.
for one day the row should inserted only once. so i bring the date from datebase and compare it with currentdate if it is equal to i set the flag in context. based on the flag y or n i set the ui element to visible insivible as if a row instered for a particular day the ui element should not display.
thanks ,
chandra.
‎2006 Jul 06 4:03 PM
‎2006 Jul 06 4:05 PM
hi,
Check the date that you are getting from table in debug mode.
and then compare it,
it must work.
regards,
Manohar
‎2006 Jul 06 4:12 PM
Hi ,
i am storing sy-datum in database table along with bunch of other fields.
for one day the row should inserted only once. so i bring the date from datebase and compare it with currentdate if it is equal to i set the flag in context. based on the flag y or n i set the ui element to visible insivible as if a row instered for a particular day the ui element should not display.
thanks ,
chandra.
‎2006 Jul 06 4:14 PM
Well then you code is ok. It should work. But you might want to get the db table with the current date. If it gets a hit, then SY-SUBRC = 0 and you should set the flag.
data: xztab type ztab.
clear xztab.
select Single * from ztab into xztab
where datum = sy-datum.
if sy-subrc = 0.
flat = 'Y'.
endif.Regards,
Rich Heilman
‎2006 Jul 06 4:17 PM
Hi,
If you check the date values in debug mode. It will always be in the form of yyyymmdd.
So there is no point of different in both values.
You can compare the values as you want.
Thanks,
G.S.K
‎2006 Jul 06 4:34 PM
HI ,
When i display the date it is displayed as 20060706.
when i do this
DIFF = CURRENTDATE - SYSTEMDATE . i always get diff as 7 even if i do 20060706 - 20060706.
can any one try this ?
thanks,
chandra.
‎2006 Jul 06 4:44 PM
‎2006 Jul 06 4:41 PM
hi Rich Heilman,
your solution worked. let me know if you have not received the points.
thanks ,
chandra.