‎2010 Nov 19 2:23 PM
Hi All,
I have one requirement like I need to fetch the data from the table, In that table one filed (XXXXX) domain type is STAMP.
delete the data if the sy-datum ( length 😎 is greater than field XXXXX which has length 14.
Please suggest me how to delete or fetch the data with the same length.
I have used below code..but did not work..
"Concatenate sy-datum '%' into gv_var1.
select *
from DD03l
into itab
where XXXX like gv_var1."
and tried this one as well
1. DELETE itab WHERE XXXXX GT sy-datum.
2. DELETE itab WHERE XXXXX GT gv_var1.
‎2010 Nov 19 2:41 PM
Hi,
When dates are in different formats you have to always convert them into one common format and then do the checks. Its better to convert the date in the variable into timestamp(using CONVERT DATE statement-look for abapdocu for its usage) and then compare it with the date on database.
data: gv_var1 TYPE timestamp.
convert date sy-datum into time stamp gv_var1.
select *
from DD03l
into itab
where XXXX like gv_var1.
should work now.
Hope this helps.
Shwetha
‎2010 Nov 19 2:41 PM
Hi,
When dates are in different formats you have to always convert them into one common format and then do the checks. Its better to convert the date in the variable into timestamp(using CONVERT DATE statement-look for abapdocu for its usage) and then compare it with the date on database.
data: gv_var1 TYPE timestamp.
convert date sy-datum into time stamp gv_var1.
select *
from DD03l
into itab
where XXXX like gv_var1.
should work now.
Hope this helps.
Shwetha
‎2010 Nov 19 4:34 PM
Thanks Shwetha for your reply..Whatever you have given that did not work for me..
However I got the solution.