‎2007 Oct 18 8:58 PM
Hi All,
I have got an issue, I have written the folowing code and getting this error"<b>Incorrect expression "+" in logical condition."</b>
select ebeln eindt into table it_eket
from eket
for all entries in it_ekpo
where ebeln = it_ekpo-ebeln and
eindt <= syst-datum + 5 .
Can you please help me out....
Rajeev
‎2007 Oct 18 9:01 PM
Hi,
You have to declare a variable for the date and use that date in your select statement
data: v_date type sydatum.
v_date = sy-datum + 5.
select ebeln eindt into table it_eket
from eket
for all entries in it_ekpo
where ebeln = it_ekpo-ebeln and
eindt <= v_date .
Thanks
naren
‎2007 Oct 18 9:01 PM
Hi,
You have to declare a variable for the date and use that date in your select statement
data: v_date type sydatum.
v_date = sy-datum + 5.
select ebeln eindt into table it_eket
from eket
for all entries in it_ekpo
where ebeln = it_ekpo-ebeln and
eindt <= v_date .
Thanks
naren
‎2007 Oct 18 9:01 PM
Hi,
Please try this.
data: wa_eindt like sy-datum.
wa_eindt = sy-datum + 5.
select ebeln eindt into table it_eket
from eket
for all entries in it_ekpo
where ebeln = it_ekpo-ebeln and
eindt <= wa_eindt.
Regards,
Ferry Lianto
‎2007 Oct 18 9:01 PM
You cannot use offsets in a WHERE. You'll have to move the value you want into a separate variable.
Rob
‎2007 Oct 18 9:02 PM
‎2007 Oct 18 9:03 PM
>>eindt <= syst-datum + 5 .
Try this
this statement wont work. Declare another field as datum
datum1 = syst-datum + 5.
select ebeln eindt into table it_eket
from eket
for all entries in it_ekpo
where ebeln = it_ekpo-ebeln and
eindt <= datum1 .
Regards
Aneesh
‎2007 Oct 18 9:04 PM
What are you trying to get with this statement? Are you looking at current date plus 5 days or are you taking the offset of eindt from the 5th position?
I think you want to read all records with eindt less than or equal to current date plus 5 days. Declare another variable of type date and do the calculation before the select statement as below.
data: l_eindt like eket-eindt.
l_eindt = sy-datum + 5.
select ebeln eindt into table it_eket
from eket
for all entries in it_ekpo
where ebeln = it_ekpo-ebeln and
eindt <= l_eindt .
Another suggestion is that you should use EBELP (line item number) also in your internal tables, otherwise you may get incorrect values.
‎2007 Oct 18 9:06 PM
Hi you can not use logical expression in this way into select statement....
store the value of the date in temporary variable and then use it..
data : <b>tempdate</b> like syst-datum.
tempdate = syst-datum + 5.
select ebeln eindt into table it_eket
from eket
for all entries in it_ekpo
where ebeln = it_ekpo-ebeln and
eindt <= <b>tempdate</b>.
Thanks & Regards
ilesh 24x7