Skip to Content
author's profile photo Former Member
Former Member

nested select stmts

hi

how can we avoid nested select statements?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 04, 2007 at 08:52 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 04, 2007 at 09:01 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.