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: 

Nested joins..Rectify the code

Former Member
0 Kudos

Hi All,

I have written the following code joining view VF_KRED and table ADRC.

Now I want to join these two with ADR6 table where

link between these is: VF_KREDADRNR = ADR6ADDRNUMBER ??

How wiill the Nested join statement be written ??

Code:-

+Start-of-Selection.

select stceg stcd2 vf_kred~name1 ort01 pstlz land1 telf1 telfx brsch

sperr lifnr zterm adrnr street house_num1

into corresponding fields of table int_create_vendor

from Vf_kred left

outer join adrc on vf_kredadrnr = adrcaddrnumber

where bukrs IN s_bukrs OR ktokk IN s_ktokk OR lifnr IN s_lifnr.+

1 ACCEPTED SOLUTION

andreas_mann3
Active Contributor
0 Kudos

try:

select lifnr street smtp_addr ...

into corresponding fields of table int_create_vendor

from ( Vf_kred left

outer join adrc on vf_kredadrnr = adrcaddrnumber )

join adr6 as a6 on adrcaddrnumber = a6ADDRNUMBER

where bukrs IN s_bukrs OR ktokk IN s_ktokk OR lifnr IN s_lifnr.

hope that helps

God's blessing

Andreas

1 REPLY 1

andreas_mann3
Active Contributor
0 Kudos

try:

select lifnr street smtp_addr ...

into corresponding fields of table int_create_vendor

from ( Vf_kred left

outer join adrc on vf_kredadrnr = adrcaddrnumber )

join adr6 as a6 on adrcaddrnumber = a6ADDRNUMBER

where bukrs IN s_bukrs OR ktokk IN s_ktokk OR lifnr IN s_lifnr.

hope that helps

God's blessing

Andreas