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 with and without for all entries giving different results

former_member215563
Active Participant
0 Kudos

Hi All,

For some reason unknown to me ,

There is a difference in result between the below mentioned query however the logic is same.

1 .  lw_ebeln-EBELN = '0000366416'.

     APPEND lw_ebeln to lt_ebeln. 

      SELECT    ebeln

     FROM     ekbe

     INTO TABLE lt_ekbe

     FOR ALL ENTRIES IN lt_ebeln

     WHERE ebeln = lt_ebeln-ebeln


2. SELECT ebeln from ekbe into table lt_ekbe where

ebeln = '0000366416'..

I have tried a lot to find the reason but unable to.

Thanks,

Faiz

4 REPLIES 4

PeterJonker
Active Contributor
0 Kudos

So what is the result in both cases ? What is the difference

I guess this is pseudo code because otherwise it would not make much sense.

The result will always be a table with only  '0000366416' so I am wondering which result you are getting.

Is your Lw_ebeln-ebeln of type EBELN ? And how did you define table LT_EKBE ?

raymond_giuseppi
Active Contributor
0 Kudos

Read more carefully documentation for FOR ALL ENTRIES (look for word "duplicate")

(As a rule, for ALL ENTRIES, try to extract the whole primary key)

Regards,

Raymond

FredericGirod
Active Contributor
0 Kudos

Hi,

it's an know issue explain in the doc :

"Rows that appear in duplicate are removed from the result set automatically"

try in your example to add the EBELP value

regards

Fred

VenkatRamesh_V
Active Contributor
0 Kudos

Hi faizur,

Hope it help ful.

If you add the EBELP in Internal table,  you will be getting same number of entries in both query.

For all entries Removes the Duplicate key.

Regards,

Venkat.