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: 

append two structures in an internal table.

Former Member
0 Kudos

hi,

if i join two tables by innerjoining will it effect the performance?If such,how i can join these with better performance?can i get the data from different tables in a single internal table by appending different structures in this case?Please answer me.

1 ACCEPTED SOLUTION

former_member181995
Active Contributor
0 Kudos

Still am searching on for all entries vs join but yet i didnt got any proper solution which is better.

there is no way that we can say for all entries are better instead of join as other replied.

Surly its all depends on situation some time inner join are far batter than FAE

check this blog:

7 REPLIES 7

Former Member
0 Kudos

Hi,

By using for all entries you can reduce the performance.

Former Member
0 Kudos

use FOR ALL ENTRIES instead of INNER JOINS.

Inner Joins more than two levels will have great impact on performance.

Former Member
0 Kudos

YES. Using of inner join will affect the performance.

do it in the following way,

Step 1.

take 2 internal table compatible to each of the database table.

Step 2.

Use SELECT query in 1st data table keeping the field sequence of in where clause same as that of the table

Step3.

use 2 nd SELECT query to fetch data from the 2nd table using FOR ALL ENTRIES

For syntax and sample code, check,

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3a1f358411d1829f0000e829fbfe/content.htm

step4:

LOOP at itab1.

READ itab2

assign value to final table field

Append the data

Regards,

Anirban

Former Member
0 Kudos

Hi Debabina,

You may ceate an internal table which has both the table fields, bit these two tables should be releated to each other.

How do you process the table will decide the performance.

former_member181995
Active Contributor
0 Kudos

Still am searching on for all entries vs join but yet i didnt got any proper solution which is better.

there is no way that we can say for all entries are better instead of join as other replied.

Surly its all depends on situation some time inner join are far batter than FAE

check this blog:

Former Member
0 Kudos

If inner Join has a performance issue the best thing u can do is...

Create 3 int tables. "This is to avoid 'INTO CORRESPONDING FIELDS' select query which will affect performance.

itab1 with the structure of table1

itab2 with the structure of table2

itab3 with the structure of table1 & table2

Select from 1st table into itab1.

if itab1 is not initial.

select from table 2 into itab2 for all entries in itab1 where field = itab1-field.

sort itab2 by field. "For binary search

loop itab1.

move-corresponding itab1 to itab3.

read itab2 with key field = itab1-field binary search.

move-corresponding itab2 to itab3.

append itab3.

endloop.

Regards

Sathar

Edited by: Sathar RA on Sep 8, 2008 9:10 AM

Former Member
0 Kudos

Hi,

Inner Joins would surely give you performance issue.

However, do not try to put the data from 2 data base tables into single internal table........This will as well create performance issue for you....

There is no problem with inner joins if the tables are not Transaction tables....Also, put the data into 2 separate internal tables...

This would be better as per your scenario....

Regards,

Kunjal