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: 

Inner join Vs Outer join with ABAP code...?

Former Member
0 Kudos
121

Inner join Vs Outer join with ABAP code...?

3 REPLIES 3

Former Member
0 Kudos
35

Inner Join means, it will not select that recor at all, unless there is a matching entry in the second table.

suppose table VBAK INNER join table VBAP on VBAKVBELN = VBAPVBELN.

In this case, if there are no entries in VBAP, the header entry also will not show up.

But in case of OUTER JOIN, even if there is no items, it will show the header entry(VBAK) with blank columns for fields from item table.(VBAP)

here is one sample for inner join.

SELECT A~EBELN

A~EKORG

A~EKGRP

A~BSART

A~LPONR

A~LOEKZ

A~LIFNR

A~RESWK

B~AEDAT

B~WERKS

B~MATNR

B~MENGE

B~EBELP

B~ELIKZ

B~PLIFZ

B~PSTYP

B~KNTTP

B~MATKL

B~ZZD_PLANT

FROM EKKO AS A INNER JOIN EKPO AS B

ON

AEBELN = BEBELN

INTO CORRESPONDING FIELDS OF TABLE T_DATA

FOR ALL ENTRIES IN T_EKET

WHERE

A~EBELN EQ T_EKET-EBELN AND

A~BSART EQ C_UBSTO AND

A~EKORG IN S_EKORG AND

A~EKGRP IN S_EKGRP AND

A~BSTYP EQ C_BSTYP AND

A~LOEKZ EQ SPACE AND " Order not deleted

A~RESWK IN S_RESWK AND

B~EBELN EQ T_EKET-EBELN AND

B~EBELP EQ T_EKET-EBELP AND

B~WERKS IN S_WERKS AND

B~MATNR IN S_MATNR AND

B~MATKL IN S_MATKL AND

B~LOEKZ EQ SPACE. " Line item not deleted

Former Member

Former Member
0 Kudos
35

HI

Check this if is helpful.

The data that can be selected with a view depends primarily on whether the view implements an inner join or an outer join.

INNER JOIN

With an inner join, you only get the records of the cross-product for which there is an entry in all tables used in the view.

OUTER JOIN

With an outer join, records are also selected for which there is no entry in some of the tables used in the view.

Regards

Dinesh