Skip to Content
avatar image
Former Member

Performance issues in ABAP programs

What are the statements which might cause performance issues in an ABAP program.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

13 Answers

  • Oct 17, 2008 at 07:15 AM
    DO.
    ENDDO.

    What I'm trying to say is, search this forum and SDN in general for lots of available, valuable information on this topic.

    Thomas

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 17, 2008 at 09:02 AM

    mainly operation with internal tables, if the internal tables become

    large.

    Sooner or larger you will encounter task where large table must be compared or connected.

    Then you should not use

    loop at itab1

    read table itab2

    with a standard table itab2

    Either use a sorted table or a binary search with the standard table.

    Rest of the problems is not related to the statements, but to the people calling them.

    Call too often and you run into problems.

    Siegfried

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 09:11 AM

    you should avoild nested loops and nested selects. they cause performance issues.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 09:29 AM

    ENDSELECT

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 17, 2008 at 10:21 AM

    > you should avoild nested loops and nested selects. they cause performance issues

    There are recommendations of this type which make sense ,Avoid smoking, it can kill you',

    but already 'Avoid driving, it can kill you', is also true, but not really practical.

    The same holds for 'avoid nested loops and nested selects'.

    Nested loops are unavoidable, but actually not a problem, just use sorted tables and everything is o.k.

    Nested selects, use Joins or For all entries and it works usually fine.

    And whether you use SELECT INTO TABLE or SELECT ... ENDSELECT the difference is smaller than many people expect.

    Siegfried

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 11:51 AM

    Hi,

    Any Code/Statement, raising the no of Database Interaction's/Database WP's can lead to performance issues.

    Stick to the Principle....Minimum no of Database Operation's at the RUN TIME......

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 17, 2008 at 11:54 AM

    Really, perform some [search at sdn for you keywords|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_weblog&query=abapperformancestatement&adv=false&sortby=cm_rnd_rankvalue].

    Regards

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 17, 2008 at 12:00 PM

    Hi,

    1.Dont Use the select and endselect.

    2. For the joining ,insteated of using the inner join better use the for all entries .

    3. Dont write the select statements in the loop.

    4.For the seelct qurey ,use index

    5.Sort the internal table before using the for all entries.

    6. Read the internal table with binary search.

    7.Use the move rather than move-corresponding

    8.Check the return code :The return code should always be checked after any database table read/update statements.

    Regards,

    Bharani

    Add comment
    10|10000 characters needed characters exceeded

    • 2. For the joining ,insteated of using the inner join better use the for all entries .

      this has been discussed here numerous times, however the consequence was different...

      5.Sort the internal table before using the for all entries.

      I wonder if that makes any difference, however I would hear some expert opinion about the topic, my question is slightly different: in case of FOR ALL ENTRIES does it matter if the internal tables (the one which contains the values for comparison) is STANDARD or SORTED (or HASHED)?

      8.Check the return code :The return code should always be checked after any database table read/update statements.

      that has nothing to do with performace...

  • Oct 17, 2008 at 12:32 PM

    > 5.Sort the internal table before using the for all entries.

    only if delete adjacent duplicates is applied.

    And this recommended if there can be duplicates, not if it comes from a select with unique key.

    The list of recommedation above is actually quite useless!

    Actually I thought the question refers more to pure ABAP statements not to database.

    But I guess as often it is an interview question, so better answer what people expect, otherwise they might be confused.

    Siegfried

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 01:33 PM

    Please search the forum before asking basic questions like this.

    And responders beware:

    bapi

    Rob

    Add comment
    10|10000 characters needed characters exceeded