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: 

Join

Former Member
0 Kudos

Hi, expert.Need an example of left outer join wiht more than 9 tables  (lfa1 , knvv ,t151t , bsis ,kna1 , lfb1 , bkpf , t001 , bsid )

3 REPLIES 3

Former Member
0 Kudos

BSIS,BKPF,BSID,BSID - are your driving tables related to FI documents

Rest of the tables are giving the additional information of customer and vendor details!

- the report seems to be out going and incoming payment details!

Former Member
0 Kudos

I'm try Thank you

former_member187748
Active Contributor
0 Kudos

Hi Semih,

please folow what Nabheet has sujjested, you can make subgroup of your tables in a set of 4 or 5.

Then your task will become easy, here i am showing you how to use inner join for 4 tables.

See , if you wants to do left outer join, then you have to change the declaration of left uoter join,

and also left outer join will be used differently, so you have to change this code, this is to just show you the use of join

select   essr~lblni

            essr~budat

            essr~xblnr

            essr~ebeln

            essr~ebelp

            essr~packno

            ekko~bedat

            ekko~kdatb

            ekko~kdate

            ekko~knumv

            ekpo~ebelp

            ekpo~werks

            ekpo~lgort

            ekpo~mwskz

            ekko~lifnr

            essr~txz01

            essr~lzvon

            essr~lzbis

            essr~lwert

            essr~netwr

            ekko~zterm

            tvzbt~vtext

            ekko~bukrs

            t001~butxt

            t001~adrnr

            into corresponding fields of table it_head

            from ( ( ( ( ekko

            inner join essr  on ekko~ebeln = essr~ebeln )

            inner join ekpo  on ekko~ebeln = ekpo~ebeln )

            inner join tvzbt on ekko~zterm = tvzbt~zterm )

            inner join t001  on ekko~bukrs = t001~bukrs )

            where lblni eq p_lblni

            and   tvzbt~spras = 'E'

            and   t001~spras  = 'E'

            and   ekko~loekz  = ''

            and   ekpo~ebelp  = p_ebelp

            and   ekpo~loekz  = ''

            and   essr~loekz  = ''.