10-18-2007 12:14 PM
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
10-18-2007 12:20 PM
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.
10-18-2007 12:22 PM
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.
10-18-2007 12:29 PM
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
10-18-2007 12:41 PM
10-18-2007 12:58 PM
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.
10-18-2007 1:05 PM
10-18-2007 3:05 PM
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
10-18-2007 3:14 PM
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>