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 for all entries

Former Member
0 Kudos
95

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

4 REPLIES 4

Former Member
0 Kudos
61

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

0 Kudos
61

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

Former Member
0 Kudos
61

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

0 Kudos
61

Hi,

alternative:

(directly after your select)

check sy-subrc or sy-dbcnt

A.

Message was edited by: Andreas Mann