‎2008 Aug 04 1:43 PM
Hi frnds,
In case of FOR ALL ENTRIES, we are checking the prerequisite,
whether the table contains data or not, by using
if TABLE IS NOT INITIAL.
my doubt is, if we doesn't use the statement IF TABLE IS NOT INITIAL, then what happens.................kindly let me know the ans..
regards,
rav.
‎2008 Aug 04 1:45 PM
Then all the data of second database table (i.e. one in next SELECT statement ) will be selected.
regards,
anirban
‎2008 Aug 04 1:45 PM
Hi
well if table is initial then what it will read so teh SY-SUBRC value will be 4.
Regards
pavan
‎2008 Aug 04 1:45 PM
‎2008 Aug 04 1:46 PM
Hi RAVKP ,
Even though if u don't use if TABLE IS NOT INITIAL.statement it will work unless the table contains value .
Regards,
Vikram.S
‎2008 Aug 04 1:47 PM
Hi,
1. If we don't check IF ITAB[] is not inital,
then suppose the itab does not have any records.
So logically, we should not get any matching records.
2. BUT, it does not happen, and the system fetches
ALL records.
It is similar as if we had not written/used for all entries.
regards,
amit m.
‎2008 Aug 04 1:47 PM
hiii
if data is there in first internal table then if you use select with for all entries without using if TABLE IS NOT INITIAL..then it will not effect...but if data is not there then how select query will work as it will have JOIN condition with for all entries like
SELECT matnr " Material Number
werks " Plants
prctr " Profit Center
FROM marc
INTO TABLE i_marc
FOR ALL ENTRIES IN i_mara
WHERE matnr = i_mara-matnr
AND werks IN s_werks.
in this if i_mara will not have any value then this statement wil not work properly..so it will give you a wrong output or error.
regards
twinkal
‎2008 Aug 04 1:48 PM
Hi,
It will bring all the data records from the corresponding table.
suppose
select carrid
connid
for all entries t_spfli
from sflight.
where carrid eq t_spfli-carrid.
in this case if t_spfli is empty
then it will bring all records irrespective condition from sflight.