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: 

very urgent-----help in performance tuning

selvi1
Explorer
0 Kudos
104

hai all,

I had used inner join for getting data from 5 tables.

performance is very low in this case.

now i want to increase the performance. how can i do this.

coding for the select statement is ......

SELECT agpnr bname1 bname2 bpstlz bort01 bstras b~street2

bname1_maco bname2_maco baliasname bispadrbsnd

INTO CORRESPONDING FIELDS OF TABLE it_tab

FROM jgtgpnr AS a

INNER JOIN jgtsadr AS b ON

aadrnr = badrnr

INNER JOIN jjtvm AS c ON

agpnr = ckunnr

INNER JOIN kna1 AS k ON

agpnr = kkunnr

INNER JOIN knvv AS v ON

agpnr = vkunnr

WHERE ( ajktokd = 'MADV' OR ajktokd = 'MADO' )

AND c~vkorg = pr_vkorg

AND v~vkorg = pr_vkorg

AND gpnr IN so_gpnr

AND k~aufsd IN so_block

AND v~aufsd IN so_blck

please give me a good suggesstion for this.

thanks in advance.

8 REPLIES 8

Former Member
0 Kudos
67

hi Selvi,

Use<b> For all entries</b> statement instead of joins ..

reggards,

Santosh

0 Kudos
67

create a database view for the tables involved in the query

Former Member
0 Kudos
67

try to use inner joins for two tables only and after that use for all entries.

regards

shiba dutta

Former Member
0 Kudos
67

Hi,

1.Declare the Internal Table fields in the correct order of sequence i.e mentioned in Select Statement and write INTO TABLE instead of INTO CORRESPONDING field.

2. Use the correct Field Linkage for ON CONDITION( if key fields are used it's good)

3. Ensure that Data is present in all the tables for the Linked fields.

Regards,

Anji

Former Member
0 Kudos
67

Hi

Try to use for all entries

Eg

if u have itab1 and itab2.

select vbeln netwr from vbak into table itab1.

if not itab1[] is initial

select vbeln matnr matkl from vbap into table itab2

for all entries in itab1 where vbeln = itab1-vbeln.

endif.

Hope this will help u.

regards

P.Thangaraj

Former Member
0 Kudos
67

Hi,

I think it is better u use for all entries rather than inner join.

Regards,

Sruthi

Former Member
0 Kudos
67

hi

i would suggest u to create the view of those table which u r trying to join it..inner join makes the performance low..if not..try to fetch the data using for all entries which is recommended one...for performance..seee the tcode slin or st05..

regards,

shamim.

0 Kudos
67

ok at first i would go to TA: ST05 and enable the sql trace.

When done execute your code, go back to ST05, disable the trace and then view your trace.

Why do we do that?

cause it´s essential to know where your time is wasted.

Probably 80% of the time is beeing wasted on the database, which means you should rather go for the hints "For all entries". if there should be a problem in your ABAP, then go for the hint that advices you not to do "into corresponding fields".