2007 Aug 12 9:13 AM
hi can u tell me about innerjoins
or from where i can get the tutorial of inner joins in abap
2007 Aug 12 9:50 AM
Hi
you can find inner join materials in Book, Teach yourself ABAP/4 in 21 days.
Regards ,
James
2007 Aug 12 10:37 AM
hi
inner join is used to select fields from more than one different tables having one field which is common to all of them which is used as condition of join.
here is an example of inner join that i have used in my program.
SELECT d1~objnr
d1~stsma
d2~estat
d2~txt04
INTO TABLE it_tab1
FROM jsto AS d1 JOIN tj30t AS d2
ON d1stsma = d2stsma.
hope this will clarify how to use inner joins.
regards
gaurav
2007 Aug 12 11:35 AM
Hi,
Inner joins are used to find records from two or more different tables using the relation between the tables.
say lets have 2 tables VBAP and VBAK. they are as follows.
content of VBAK.
VBELN ERDAT ERNAM AUART
1001 20021011 10 12
1002 20021012 12 12
1003 20021011 13 14
Content of VBAP.
VBELN POSNR MATNR MATKL
1001 10 12 12
1002 13 12 14
1002 10 1 1
Now we have VBELN as the Key for these two tables. so we write the select query as
SELECT vbak~vbeln
vbak~erdat
vbak~ernam
vbak~auart
vbap~posnr
vbap~matnr
vbap~matkl
INTO TABLE tbl_values
FROM vbak JOIN vbap ON vbapvbeln = vbakvbeln.
The output will be
VBELN ERDAT ERNAM AUART POSNR MATNR MATKL
1001 20021011 10 12 10 12 12
1002 20021012 12 12 13 12 14
1002 20021012 12 12 10 1 1
Reward points if usefull.
Regards,
Niyaz