‎2018 Apr 06 6:51 AM
Hi ABAP,
I am an abap newbie. I have written a code that needs to be optimized.
Not sure if my attached ABAP source code is already optimized.
Please check my source code and provide comments or suggestions if it is optimized or not.
Thank you
Juan
‎2018 Apr 06 10:07 AM
‎2018 Apr 06 7:00 AM
No. It's not optimised.
It uses performs, which are obsolete ABAP constructs. You should re-write in an object oriented fashion ,
It's not well modularised. Rule of thumb, no modular unit should be more than about 20 statements. (Rule of thumb so there are exceptions).
You've not used HASHED or SORTED tables.
Looks like you've got nested database selects - you don't have any INNER JOINs.
Rather than ask if your code is optimised, why don't you research the tools that analyse the runtime and apply them. Find out where the bottlenecks are and look for ways to improve.
‎2018 Apr 06 10:07 AM
‎2018 Apr 06 10:44 AM
Maybe it is a good idea, to read the ABAP Programming Guidelines and to follow the rules:
https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenabap_pgl.htm
‎2018 Apr 19 7:09 AM
Hi ABAP Gurus,
Please see my attached file.
Do you think my program is now optimized?
Thank you all sooooo much.
Juan
‎2018 Apr 19 7:38 AM
I refer you to my earlier answer:
No. It's not optimised.
It uses performs, which are obsolete ABAP constructs. You should re-write in an object oriented fashion ,
It's not well modularised. Rule of thumb, no modular unit should be more than about 20 statements. (Rule of thumb so there are exceptions).
You've not used HASHED or SORTED tables.
Looks like you've got nested database selects - you don't have any INNER JOINs.
Rather than ask if your code is optimised, why don't you research the tools that analyse the runtime and apply them. Find out where the bottlenecks are and look for ways to improve.
You don't appear to have followed the advice in the links in the answer you've marked as accepted (even though it got negative votes).