Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

Proposal for a sticky thread "Performance of SAP standard"

Former Member
0 Kudos


in this form there are many questions about your programs, selects function modules but what about the SAP standard programs, they are not always the best performing things on your system. What do you think about a thread with improvements of SAP standard programs?

Ok, that should be the job of SAP, but sometimes everybody needs a little kick.

So this thread should collect suggestions of improvements of SAP coding. These suggestions should be very precise, so SAP should implement them easily. I'm pretty sure, everybody will find some not optimized code during debugging, learning, ... .

So , lets start with an example


SELECT SINGLE * FROM caufv WHERE aufnr EQ aufnr.

There is no need for select *, because only the fields







are needed during the FM.

so lets improve the code

select single aufnr loekz autyp gamng gmein rsnum
 from caufv into (wa_caufv-aufnr, 
                  gamng, gmein, rsnum)

With this code we can also kill three moves in the last lines.

MOVE: caufv-gamng TO gamng,
      caufv-gmein TO gmein,
      caufv-rsnum TO rsnum.

That was easy, on my testsystem it is 38% less database-time for the select and a little for the three moves.

What do you think?



Former Member
0 Kudos

Hi Matthias,

OSS/SAP Notes (

<a href=""></a>)

is often where you can find such issues raised. Or raise one yourself this way.

ABAP is an evolving language, e.g., SELECT * was the only way of reading a table until ver 3 (about 1996). So SAP does not rewrite all its programs every time there is a new release, nor do we when we upgrade our own SAP systems.

Also we may be putting SAP code to uses that SAP did not intend it to be used for, or volumes.

Former Member
0 Kudos


0 Kudos

Not sure I'm on board, I doubt SAP will take suggestions for modifying their code via a forum post, I think it is best to go thru OSS.

Anyway, a little story for ya. We had a program which was sort of like CO41(collective planned order conversion), but was custom because we needed to include characterisics, so we have this program that gets all of the planned orders and then does CO40 transaction over each one. This worked in the begining, but after some time the runtime was extremely bad, like hours long. So I did some investigation and found the exact SELECT statement deep inside of CO40, and found that the WHERE clause was not written in such a way that was good for my company. I contacted OSS, and pointed them to the exact place in the code that was giving us a problem. I told them that the one line in the WHERE clause needed to b commented out, then the performance would be much better. They came back after a number of days, and said, the SELECT statement was written in such a way that it works for all business processes. At my company, our business process dictated that the one line in the WHERE clause was not necessary and even hurting our performance. Anyway, they said they would not issue a change for us and that we either had to hack it ourselves or totally redo the way our task list groups where set up. The problem was is that we had a couple task list groups, with thousands and thousands of materials assign to it. This was the problem. So I hacked the standard program, and it actually shaved of 3 hours of processing time.


Rich Heilman

Former Member
0 Kudos

My grandma told me "do not try to repair something if it's not broken" 🐵

I'm sure there is a code in SAP which may cause performance problems for your system, but OSS is really the best way to suggest improvements as it may be that you use SAP in a bit "unusual way" and nobody else has this problem OR you suggest improvement which can cause problems in other code. In case of OSS note your note is routed to the right people in SAP which can evaluate your suggestion and modify it if necessary so it does not break anything else. We had a performance issue and suggested a fix which was actually implemented by SAP so it really works 🐵 but sometimes it's really faster to tweak your DB a bit or modify SAP code if the problem is actually caused by the way you configured & use SAP.