Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

select query

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

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..

0 Kudos

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)

0 Kudos

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.

former_member200338
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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...

Former Member
0 Kudos

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