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

nested select stmts

Former Member
0 Likes
410

hi

how can we avoid nested select statements?

2 REPLIES 2
Read only

Former Member
0 Likes
386

Hi

WE can use For all entries of one particular ITAB

and write a separate select to other database tables

and finally looping the first ITAB.

and reading the other internal tables..

and appending data into a final ITAB.

see the doc

1 Always check the driver internal tables is not empty, while using FOR ALL ENTRIES

2 Avoid for all entries in JOINS

3 Try to avoid joins and use FOR ALL ENTRIES.

4 Try to restrict the joins to 1 level only ie only for 2 tables

5 Avoid using Select *.

6 Avoid having multiple Selects from the same table in the same object.

7 Try to minimize the number of variables to save memory.

8 The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)

9 Avoid creation of index as far as possible

10 Avoid operators like <>, > , < & like % in where clause conditions

11 Avoid select/select single statements in loops.

12 Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH.

13 Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,)

14 Avoid using ORDER BY in selects

15 Avoid Nested Selects

16 Avoid Nested Loops of Internal Tables

17 Try to use FIELD SYMBOLS.

18 Try to avoid into Corresponding Fields of

19 Avoid using Select Distinct, Use DELETE ADJACENT.

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
386

Hi,

In SE38 follow the menu path -> Environment -> Examples -> Performance Examples.

Refer to SQL Interface. You would find performance examles for Internal Tables, field conversion, ABAP Objects etc.

You can compare the time taken for different type of statements.

Hope this will help.

Regards,

Srilatha.