Skip to Content
0
Former Member
Nov 09, 2006 at 01:54 PM

Proposal for a sticky thread "Performance of SAP standard"

32 Views

Hello,

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

Function module CO_SF_HEADER_GOODS_ISSUE

SELECT SINGLE * FROM caufv WHERE aufnr EQ aufnr.

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

autyp

loekz

objnr

gamng

gmein

rsnum

are needed during the FM.

so lets improve the code

select single aufnr loekz autyp gamng gmein rsnum
 from caufv into (wa_caufv-aufnr, 
                  wa_caufv-loekz,
                  wa_caufv-autyp,
                  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?

Matthias