2006 Oct 13 6:34 AM
hi all,
in the following code select for all entries
why we r checking that
if not ITAB_BSIS[] is initial.
what does it mean? what is its necessicity
plz give me solution
SELECT
bukrs
hkont
augdt
augbl
zuonr
gjahr
belnr
buzei
budat
bldat
WAERS
xblnr
blart
shkzg
dmbtr
wrbtr
sgtxt
aufnr
kostl
dmbe2
prctr
zztitle
zzterr
FROM bsis
into table ITAB_BSIS "Declare an Internal table with
"all above selected fields
WHERE bukrs IN so_bukrs
AND hkont = so_hkont
AND augdt = so_augdt
AND gjahr = so_gjahr
AND belnr = so_belnr
AND budat = so_budat
AND blart = so_blart
AND xblnr = so_xblnr
AND bldat = so_bldat
AND zztitle = so_title
AND zzterr = so_terr
AND kostl = so_kostl
AND prctr = so_prctr
AND aufnr = so_aufnr.
if not ITAB_BSIS[] is initial.
select BUKRS BELNR GJAHR bvorg bstat waers hwaer hwae2 cpudt
from bkpf
into table ITAB_BKPF "Declare an Internal table with
"all above selected fields
for all entries in ITAB_BSIS
where bukrs = ITAB_BSIS-bukrs
and belnr = ITAB_BSIS-belnr
and gjahr = ITAB_BSIS-gjahr
AND cpudt = so_cpudt
AND bvorg = so_bvorg.
endif.
thanks & regards
sanjeev
2006 Oct 13 6:37 AM
If you are not checking ITAB_BSIS[] is initial or not, then it will select all the data from database table BKPF if ur internal table doesnt contain any values.
Best Regards,
Vibha
*Please mark all the helpful answers
2006 Oct 13 7:13 AM
sorry right now there is some error in page of rewarding points.
as soon as it will be ok i will reward u.
thanks for the answer
2006 Oct 13 6:38 AM
Hi Sanjeev,
We need to check whether the parent table is empty whenever we user FOR ALL ENTRIES. This is because if the parent table is empty then all the records from parent table will be taken into considerasion and it will fetch the data accordingly.
Regards,
Dharitree
2006 Oct 13 6:57 AM
Hi,
alternative:
(directly after your select)
check sy-subrc or sy-dbcnt
A.
Message was edited by: Andreas Mann