‎2008 May 12 6:53 AM
hi friends,
i am facing a problem with my slect statement. i need to get details greater than the date given in select stmt, but i'm not geting it. please do help me .
select ebeln
bsart
aedat
ernam
lifnr
from ekko
into table it_ekko
where ebeln eq ekko-ebeln
and aedat gt '20080424'
and bsart <> 'AN'
'20080424'
and frggr is null or frgsx is null or frgke eq '1'.
‎2008 May 12 7:11 AM
Hi you are selecting the data from the ekko table and in ur where condition ur giving it as where ebeln = ekko-ebeln .
in ekko-ebeln there is no value this will not give you what u are looking for. Please check this out..
‎2008 May 12 6:56 AM
hi
u can do 1 thing
data : dat type sy-datum.
dat = '20080424'.
select ebeln
bsart
aedat
ernam
lifnr
from ekko
into table it_ekko
where ebeln eq ekko-ebeln
and aedat gt dat
and bsart 'AN'
check whether it wrk.
with regards
Rohan Shetty
‎2008 May 12 6:58 AM
your are selecting and comparing from same table EKKO, this is not possible!!!!
where ebeln eq ekko-ebeln.
1. ekko-vbeln was previously filled in another select.
2. ekko-vbeln should be replaced by parameter or variable.
Edited by: Micky Oestreich on May 12, 2008 7:58 AM
‎2008 May 12 7:00 AM
hi Kat,
do this way ..
data : v_date like ekko-aedat value '20080424'.
select ebeln
bsart
aedat
ernam
lifnr
from ekko
into table it_ekko
where
*ebeln eq ekko-ebeln
and aedat gt v_date
and bsart 'AN'
and ( frggr is null or
frgsx is null or
frgke eq '1' ) .Regards,
santosh
‎2008 May 12 7:05 AM
Micky Oestreich
is right
i think u have to check ur code
y r u using the same table again and again
even do my 1 ans is appropriate but goin to same table again n again is not appropriate
Edited by: Rohan Shetty on May 12, 2008 8:06 AM
‎2008 May 12 7:11 AM
Hi you are selecting the data from the ekko table and in ur where condition ur giving it as where ebeln = ekko-ebeln .
in ekko-ebeln there is no value this will not give you what u are looking for. Please check this out..
‎2008 May 12 8:48 AM
actually there is no need to use
ebeln eq ekko-ebeln in where clause
thank u friends,