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: 

abt inner joins

Former Member
0 Kudos

hi can u tell me about innerjoins

or from where i can get the tutorial of inner joins in abap

3 REPLIES 3

Former Member
0 Kudos

Hi

you can find inner join materials in Book, Teach yourself ABAP/4 in 21 days.

Regards ,

James

Former Member
0 Kudos

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

former_member200338
Active Contributor
0 Kudos

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