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: 

inner join for 4 tables

Former Member
0 Kudos
118

Hi forum,

Pls correct the following code..

SELECT a~zbukr

a~hbkid

a~hktid

a~checf

a~waers

a~rwbtr

a~bancd

a~vblnr

a~pernr

a~voidr

a~rzawe

a~laufd

a~empfg

a~gjahr

a~zaldt

a~znme1

a~rec_belnr

b~bankl

c~bankn

d~duedt

INTO CORRESPONDING FIELDS OF TABLE it

FROM payr AS a

INNER JOIN t012 AS b

ON ahbkid = bhbkid

inner join t012k as c

on bhbkid = chbkid

  • and on ahbkid = chbkid

inner join t51r5 as d

on cbukrs = dbukrs

  • and on awaers = dwaers

WHERE a~zaldt IN s_zaldt

AND a~vblnr IN s_vblnr

AND a~znme1 IN s_znme1

AND a~rec_belnr IN s_rec

AND a~waers IN s_waers.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
72

Hi mahati,

This is kiran kumar.G.plz check the below select statement that will solve ur problem check it once ok..

SELECT a~zbukr

a~hbkid

a~hktid

a~checf

a~waers

a~rwbtr

a~bancd

a~vblnr

a~pernr

a~voidr

a~rzawe

a~laufd

a~empfg

a~gjahr

a~zaldt

a~znme1

a~rec_belnr

b~bankl

c~bankn

d~duedt

FROM payr AS a

INNER JOIN t012 AS b

ON ahbkid = bhbkid

inner join t012k as c

on ahbkid = chbkid

inner join t51r5 as d

on cbukrs = dbukrs

into table it

WHERE a~zaldt IN s_zaldt

AND a~vblnr IN s_vblnr

AND a~znme1 IN s_znme1

AND a~rec_belnr IN s_rec

AND a~waers IN s_waers.

Award points if helpful.

Kiran Kumar.G

Have a Nice Day.

1 REPLY 1

Former Member
0 Kudos
73

Hi mahati,

This is kiran kumar.G.plz check the below select statement that will solve ur problem check it once ok..

SELECT a~zbukr

a~hbkid

a~hktid

a~checf

a~waers

a~rwbtr

a~bancd

a~vblnr

a~pernr

a~voidr

a~rzawe

a~laufd

a~empfg

a~gjahr

a~zaldt

a~znme1

a~rec_belnr

b~bankl

c~bankn

d~duedt

FROM payr AS a

INNER JOIN t012 AS b

ON ahbkid = bhbkid

inner join t012k as c

on ahbkid = chbkid

inner join t51r5 as d

on cbukrs = dbukrs

into table it

WHERE a~zaldt IN s_zaldt

AND a~vblnr IN s_vblnr

AND a~znme1 IN s_znme1

AND a~rec_belnr IN s_rec

AND a~waers IN s_waers.

Award points if helpful.

Kiran Kumar.G

Have a Nice Day.