Skip to Content
0
Former Member
May 13, 2008 at 01:12 AM

select ... for all entries problem

108 Views

Hi,

I'm making select statements to BKPF and BSEG, but I can't do an inner join between this two table because BSEG it's a cluster table so I have to do a SELECT... FOR ALL ENTRIES, but in SE16 I make the same query that I have writen in my program as shown below,

SELECT BUKRS BELNR GJAHR BUDAT MONAT

FROM BKPF INTO CORRESPONDING FIELDS OF TABLE it_bkpf

WHERE BUKRS = 'XXX'

AND GJAHR = '2005'

AND BELNR = '0000000250'. "just for proof

AND MONAT = '10'

The above query returns me 1 row in program and in SE16 and then I make the next query for BSEG to do the join

SELECT BUKRS BELNR GJAHR BSCHL SHKZG WRBTR HKONT

FROM BSEG INTO CORRESPONDING FIELDS OF TABLE IT_BSEG

FOR ALL ENTRIES IN it_bkpf

WHERE bukrs = it_bkpf-bukrs

and gjahr = it_bkpf-gjahr

and belnr = it_bkpf-belnr.

this query returns 897 rows and in SE16 this same query returns 901 rows

Why SELECT...FOR ALL ENTRIES brings me less rows affected by the query in SE16

Thanks for your help!!