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

Performance issues in ABAP Programs

Former Member
0 Likes
1,457

Hi Guys,

Tell me how to take care of performance issues while writing any ABAP Program?

Regards,

Amruth

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
813

Dear Amruth,

The following guidelines can be used to improve the performance of an ABAP Program:

> 1. Follow the naming standards (of the company or client you are working)

> 2. Use select field one field two etc do not use select *

> 3. Avoid unnecessary loops. If requirec use loop with where clause or Read with binary search

> 4. Use case statement in place of if else

> 5. use clear table before select single or where ever applicable.

> 6. check for sy-subrc where ever applicable

> 7. avoid collect statement if possinble

> 8. do proper documentation of the program inside abap editor and also in se38 (screen-documentation radio button )

> 9. try to use views rather than nested select statement

> 10. use ABAP TRACE try to work on those SQL statements to improve performance

> 11. use index only if it is required

> 12. in internal table declaration try to use correct occurs number say occurs 1000. Otherwise use occurs 0.

> 13. while using select statements use single select, select * upto 5 rows ,etc based on the requirement.use select options wisely taking performance into account.

> 14. declare variables / parameters with meaningful words like v_matnr for material number or v_bukrs for plant or at least v_matnum for material number etc.

> 15. Beautify the code using pretty printer, pattens(***** ——- etc)

Best Regards,

Rajesh

Please reward points if found helpful.

6 REPLIES 6
Read only

Former Member
0 Likes
813

Check:

<a href="/people/rob.burbank/blog/2006/11/16/performance--what-will-kill-you-and-what-will-leave-you-with-only-a-flesh-wound">/people/rob.burbank/blog/2006/11/16/performance--what-will-kill-you-and-what-will-leave-you-with-only-a-flesh-wound</a>

Rob

Read only

Former Member
Read only

Former Member
0 Likes
813

Hi Amruth,

Performance of ABAPs can be improved by minimizing the amount of data to be transferred.

The data must be transferred throught the network to the aplications, so reducing the amount of time & also reduces the network traffic.

Some measures that can be taken care :

-Use views defined in the ABAP/4 DDIC(also has the advantage of better reusability)

-Use field list(SELECT clause) rather than SELECT *.

-Range tables should be avoided(IN Operator)

-Avoid nested SELECTs.

Regards,

Chandru

Read only

0 Likes
813

Hi Chandru,

Can u list all the performance issues that should be taken care?

Regards,

Amruth

Read only

0 Likes
813
Read only

Former Member
0 Likes
814

Dear Amruth,

The following guidelines can be used to improve the performance of an ABAP Program:

> 1. Follow the naming standards (of the company or client you are working)

> 2. Use select field one field two etc do not use select *

> 3. Avoid unnecessary loops. If requirec use loop with where clause or Read with binary search

> 4. Use case statement in place of if else

> 5. use clear table before select single or where ever applicable.

> 6. check for sy-subrc where ever applicable

> 7. avoid collect statement if possinble

> 8. do proper documentation of the program inside abap editor and also in se38 (screen-documentation radio button )

> 9. try to use views rather than nested select statement

> 10. use ABAP TRACE try to work on those SQL statements to improve performance

> 11. use index only if it is required

> 12. in internal table declaration try to use correct occurs number say occurs 1000. Otherwise use occurs 0.

> 13. while using select statements use single select, select * upto 5 rows ,etc based on the requirement.use select options wisely taking performance into account.

> 14. declare variables / parameters with meaningful words like v_matnr for material number or v_bukrs for plant or at least v_matnum for material number etc.

> 15. Beautify the code using pretty printer, pattens(***** ——- etc)

Best Regards,

Rajesh

Please reward points if found helpful.