‎2007 Mar 07 9:20 AM
Hi,
i need a sample coding for multiple table join. can anyone help me out.
regards
Gokul
‎2007 Mar 07 9:24 AM
What results r u after?????????????????????????????????????????????
ARE WE MIND READERS.
‎2007 Mar 07 9:31 AM
See demo programs:
DEMO_SELECT_INNER_JOIN
and DEMO_SELECT_LEFT_OUTER_JOIN
‎2007 Mar 07 9:32 AM
Hi,
check this.
SELECT FCARRID FCONNID F~FLDATE
INTO (CARRID, CONNID, DATE)
FROM SFLIGHT AS F INNER JOIN SPFLI AS P
ON FCARRID = PCARRID AND
FCONNID = PCONNID
WHERE P~CITYFROM = 'FRANKFURT'
AND P~CITYTO = 'NEW YORK'
AND F~FLDATE BETWEEN '20010910' AND '20010920'
AND FSEATSOCC < FSEATSMAX.
WRITE: / DATE, CARRID, CONNID.
ENDSELECT.
check this link
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_InnerJoinStatement.asp
Regards,
Sruthi
‎2007 Mar 07 9:33 AM
hi gokul,,
I am getting output for your program ,
check the tables if they have data in them ,
i am getting lots of records with your program
‎2007 Mar 07 9:33 AM
Hi,
See the sample code:
select
a~aufnr " Order Number
a~kappl " Application
a~zschl " Overhead Key
b~knumh " Cond.Record Number
c~kbetr " Overhead Rate
into table it_head
from aufk as a join a014 as b
on akappl = bkappl and
azschl = bzschl
join konp as c
on bknumh = cknumh
for all entries in it_header
where a~aufnr = it_header-aufnr and
b~kappl = 'KA' and
b~kschl = 'C110' and
b~kokrs = 'GSI1' and
b~aufza = '1' .
Regards,
Anji
‎2007 Mar 07 9:33 AM
Hi Gokul,
FIrst of all please be sure if you want to read all the data from the table, as there is no where condition in the select statements.
The use of MODIFY ITAB FROM WA in the last loop statement has no use at all.
Please remove unwanted code from the existing code and try to run the code. If you have huge data in the database then your program will run on and on....
Regards,
George
‎2007 Mar 07 9:36 AM
SELECT AVBELN AFKDAT AVTWEG ASPART AWAERK AKURRF AKUNAG AKNUMV
BPOSNR BFKIMG BNETWR BMATNR
DBEGRU ELABOR E~MATKL
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM VBRK AS A INNER JOIN VBRP AS B
ON AVBELN EQ BVBELN
INNER JOIN J_1IEXCHDR AS C
ON AVBELN EQ CRDOC
INNER JOIN KNVV AS D
ON DKUNNR EQ AKUNAG AND
DVKORG EQ AVKORG AND
DSPART EQ ASPART AND
D~BEGRU NE SPACE
INNER JOIN MARA AS E
ON EMATNR EQ BMATNR
WHERE A~FKDAT IN S_FKDAT AND
A~FKART EQ 'F2' AND
A~VTWEG IN S_VTWEG AND
A~SPART IN S_SPART AND
A~KUNAG IN S_KUNAG AND
A~FKSTO NE 'X' AND
B~WERKS IN S_WERKS AND
C~TRNTYP = 'DLFC' AND
E~LABOR IN S_LABOR AND
C~SRGRP IN ('01','02','03','31','32','33','41','42','43',
'81','82','83','95','55','45', '48') AND
B~MATNR IN S_MATNR AND
D~BEGRU IN S_BEGRU AND
E~MATKL IN S_MATKL.
but my suggestion not to use more than 2 table in inner join it will affect in performance use for all entries instead of join.
regards
shiba dutta
‎2007 Mar 07 9:39 AM
hi
good
go through these links
http://www.sapdb.org/7.4/htmhelp/45/f31c38e95511d5995d00508b5d5211/content.htm
thanks
mrutyun^