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