Application Development and Automation 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: 
Read only

abap dictionary

Former Member
0 Likes
591

What is the differance b/w inner joints & for all entries?

4 REPLIES 4
Read only

paruchuri_nagesh
Active Contributor
0 Likes
572

hi

inner joins joins the tables at data base level

but in case of for all entries it joins tables at application level

performance wise it is better to use for all entries

reward for use ful answers

regards

Nagesh.Paruchuri

Read only

Former Member
0 Likes
572

Hi anil

The different depend on your requirement in the program. in case of all entries , you need to create internal table to keep the data that you query but for inner foin there is no need .this situation depend on you would like to keep the data to use somewhere or not . when you keep the data , you can use its everywhere that you would like and it improve more performance if you have to query data every time that you would like

Regards

Wiboon

Read only

Former Member
0 Likes
572

hi

good

FOR ALL ENTRIES is an effective way of doing away with using JOIN on two tables.

You can check the below code -

SELECT BUKRS BELNR GJAHR AUGDT

FROM BSEG

INTO TABLE I_BSEG

WHERE BUKRS = ....

SELECT BUKRS BELNR BLART BLDAT

FROM BKPF

INTO TABLE I_BKPF

FOR ALL ENTRIES IN I_BSEG

WHERE BUKRS = I_BSEG-BUKRS

AND BELNR = I_BSEG-BELNR

AND BLDAT IN SO_BLDAT.

*******************************8

look another example

what is the use of FOR ALL ENTRIES

1. INNER JOIN

DBTAB1 <----


> DBTAB2

It is used to JOIN two DATABASE tables

having some COMMON fields.

2. Whereas

For All Entries,

DBTAB1 <----


> ITAB1

is not at all related to two DATABASE tables.

It is related to INTERNAL table.

3. If we want to fetch data

from some DBTABLE1

but we want to fetch

for only some records

which are contained in some internal table,

then we use for alll entries.

*----


1. simple example of for all entries.

2. NOTE THAT

In for all entries,

it is NOT necessary to use TWO DBTABLES.

(as against JOIN)

3. use this program (just copy paste)

it will fetch data

from T001

FOR ONLY TWO COMPANIES (as mentioned in itab)

4

REPORT abc.

DATA : BEGIN OF itab OCCURS 0,

bukrs LIKE t001-bukrs,

END OF itab.

DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.

*----


itab-bukrs = '1000'.

APPEND itab.

itab-bukrs = '1100'.

APPEND itab.

*----


SELECT * FROM t001

INTO TABLE t001

FOR ALL ENTRIES IN itab

WHERE bukrs = itab-bukrs.

*----


LOOP AT t001.

WRITE 😕 t001-bukrs.

ENDLOOP.

thanks

mrutyun^

Read only

Former Member
0 Likes
572

hi,

Inner join is used when we are fetching data from the DD and from the two table like MARA and MAKT at the same time by applying the join on the field MATNR.

And For All Entries is used when we are merging the two internal table into the third one.

thanks

Dharmishta