2005 Nov 22 5:38 PM
I am new in ABAP
I would like to do something like this.
SELECT sy-datum - field INTO... FROM ...
But I receive the following error ...
Unknown column name sy-datum. not determined until runtime.
How can i solve this?
Thanx
2005 Nov 22 5:44 PM
Hi,
Sy-datum is a system field.it cannot be selected.
current date will be in sy-datum.
the following statement will print current date.
write: sy-datum.
if u want to do any manipulations u can copy it to a local variable and can be used.
for ex: data:v_date type sy-datum.
v_date = sy-datum.
use v_date for further operations.
Thanks,
VAmsi.
2005 Nov 22 5:44 PM
Hi,
Sy-datum is a system field.it cannot be selected.
current date will be in sy-datum.
the following statement will print current date.
write: sy-datum.
if u want to do any manipulations u can copy it to a local variable and can be used.
for ex: data:v_date type sy-datum.
v_date = sy-datum.
use v_date for further operations.
Thanks,
VAmsi.
2005 Nov 22 5:45 PM
Jose,
U cannot use SELECT and Sy-datum.
Instead, u can have
data: myDate type sy-datum.
myDate = sy-datum - 1.
Thanks
Kam
2005 Nov 22 5:47 PM
Hi,
Its not possible to subtract the field from the sy-datum
when you are making a select.
And also you cannot select the sy-datum from the database table.
Its a structure called syst.
Cheers,
Sampath
2005 Nov 22 5:49 PM
You can't do that calc untill after the selection of data.
Data: begin of xvbak,
vbeln type vbak-vbeln,
erdat type vbak-erdat,
end of xvbak.
data: number_of_days type i.
select Single vbeln erdat into xvbak
from vbak
where vbeln = p_vbeln.
number_of_days = sy-datum - xvbak-erdat.
Welcome to SDN!
Regards,
Rich Heilman
2005 Nov 22 5:52 PM
Hi, you can do it like this:
v_fecha = sy-datum - pdias.
pdias is numeric.
Robert