Skip to Content
0
Former Member
May 30, 2007 at 12:31 PM

Inner Joins & for all entries

24 Views

Hi

1) SELECT RSEGBUKRS RSEGBELNR RSEGGJAHR RSEGBUZEI RBKPLIFNR RSEGWERKS RSEGEBELN RSEGEBELP RSEGMATNR RSEGWRBTR RBKPRBSTAT RBKPZUONR RBKPRMWWR RBKPWAERS RBKP~KURSF

INTO TABLE I_RSEG

FROM RBKP

INNER JOIN RSEG

ON

RBKPBELNR = RSEGBELNR AND

RBKPGJAHR = RSEGGJAHR

FOR ALL ENTRIES IN I_BKPF

WHERE RBKP~BELNR = I_BKPF-BELNR

AND RBKP~GJAHR = I_BKPF-GJAHR

AND RSEG~WERKS IN S_WERKS

AND RBKP~LIFNR IN S_LIFNR.

2) IF NOT I_BKPF[] IS INITIAL.

SELECT belnr gjahr lifnr rbstat zuonr rmwwr waers kursf stblg

FROM rbkp into corresponding fields of table i_rbkp1

FOR ALL ENTRIES IN I_BKPF

WHERE BELNR = I_BKPF-BELNR

AND GJAHR = I_BKPF-GJAHR

AND LIFNR = S_LIFNR.

ENDIF.

I am replacing the first select statment using inner join with for all entries. but it is not yelding same result.First select statement retrieves records while second one does not using same where conditions. How inner join would work,can we replace inner join using for all entries.

Regards,

Karthik.k