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

abap program for optimization

Former Member
1,875

ztest-program.txt

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

1 ACCEPTED SOLUTION
5 REPLIES 5
Read only

matt
Active Contributor
1,662

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.

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
1,662

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

Read only

Former Member
0 Likes
1,662

zabap.txt

Hi ABAP Gurus,

Please see my attached file.

Do you think my program is now optimized?

Thank you all sooooo much.

Juan

Read only

matt
Active Contributor
0 Likes
1,662

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).