11-27-2007 5:42 AM
Hello All,
i would like to select all the entries from EKET table with menge is greater than wemng. for this i have written a query like
select * into table lt_eket from eket for all entries in lt_ekko where ebeln = lt_ekko-ebeln and menge GT lt_eket-wemng .
this is nor giving any error, but after execution i am also getting the lines in lt_eket that wont satisfy my condition .
can someone please suggest what would be the right query?
(selecting into internal table , looping through it and deleting the entries is causing lot of performance problem)
is there any solution with single query
Thanks in advance
Amarender Reddy B
11-27-2007 5:48 AM
what amarnath..? check out once..plz..if au r ausing the for all entries condition ur basic thing is to check the ionternal table is initial or not..
if the internal table is not having any data ..it will fetch all the data..
ok..amar..i am expecting 10 points..from u ha..ha...good day take care..
11-27-2007 5:51 AM
Hello Satish,
The Itab is not initial, the lt_ekko contains the data,
after the query excution the table lt_eket contains only the entries that are in lt_ekko, but it also contains the entries which are failing my secong condition (menge > wenge)
11-27-2007 6:00 AM
hai amar actullay i am not at desk but try this first write: greater copndition with the brackets if possibel or else without brackets also possible..and then use the equal to condition and post me the answer.
11-27-2007 5:50 AM
Hi,
1) try to sort the internal table and use it in the select query.
2) use sub joins.
reward points if useful.
Regards,
Niyaz
11-27-2007 5:55 AM
Hi Amar,
Your query cannot be done..
Instead if u r concentrating on performance...
if not it_ekko is initial.
select <required fields> into table lt_eket from eket for all entries in lt_ekko where ebeln = lt_ekko-ebeln .
if sy-subrc eq 0.
loop at lt_eket .
if it_eket menge gt lt_eket-wemng.
append lt_eket1.
clear lt_eket1.
endloop.
Regards,
kaveri...
11-27-2007 6:01 AM
hi
use following code
select * into table lt_eket from eket for all entries in lt_ekko where ebeln = lt_ekko-ebeln and menge GT wemng .
L.Velu