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: 

joining three tables.. urgent(with in 15 minutes)

Former Member
0 Kudos

hi,

i have to join three tables vbak,vbuk,vbap...

i need the syntax..

when i wrote like..

select .. into table int_itab

from vbak as a join vbuk as b

on avbeln = bvbeln

join vbap as c

on cvbeln = avbeln.

where ....

for the above combination , i have only one record...

but iam getting records... i.e., it is displaying the same record twice

please help me urgently .... very fast

regards

sree

8 REPLIES 8

Former Member
0 Kudos

HI, IT IS BCOZ U HAVE WRITTEN :-

<b>on avbeln = bvbeln </b>

It should be written like dis bvbeln = avbeln and rest of ur code wil be fine and it will not dsiplay d value twice.

if u find it useful ,plz do rewards tooo.

0 Kudos

here is d code for u:-

select .. into table int_itab

from vbak as a join vbuk as b

<b>on bvbeln = avbeln

inner join vbap as c</b>

on cvbeln = avbeln.

where ....

hpoe u understood now.

do rewards if u find it useful.

0 Kudos

hi,

still it is not working.....

i have added the second join..

if i wont add the second join , the output is working nice

plzzzzzzzz.. help urgently

regards

sree

Former Member
0 Kudos

what have provided in whereclause?

psate ur code

0 Kudos

SELECT DISTINCT AVBELN AERDAT ABSTNK ABSTDK AKUNNR BSPART BMATNR BPOSNR BWERKS BPOSNR BKWMENG BKBMENG CNTGEW CBRGEW CGEWEI DWMENG DBMENG DEDATU D~VBELN

FROM VBAK AS A INNER JOIN VBAP AS B ON BVBELN = AVBELN

INNER JOIN MARA AS C ON CMATNR = BMATNR

INTO CORRESPONDING FIELDS OF TABLE ITSO

WHERE AVBELN IN SO_ORD AND AKUNNR IN SO_PARTY AND BSPART IN DIV AND AERDAT IN SO_DATE.

dis is d best exapmle of inner joins ,but do not enter more dan 3 inner joins as it will lead to

effect d efficiency.

or

u just send ur complete requierments of ur report i will provide d solution for it.

Former Member
0 Kudos

if u find it useful den do rewards toooo

Former Member
0 Kudos

HI,

THANKS FOR YOUR SUPPORT..

SINCE THERE ARE MORE THAN ONE LINE ITEM....

I GETTING LIKE THAT ..

I HAVE DONE THE NECESSARY MODIFICAITONS

IT IS SOLVED..

REGARDS

SREE

0 Kudos

I'm assuming as you didn't get your solution within the requested 15 minutes that's why you haven't acknowledged the contribution of the efforts of those listed above by the gift of points.

<a href="https://wiki.sdn.sap.com/wiki/x/FgQ">https://wiki.sdn.sap.com/wiki/x/FgQ</a>