SymptomCustomer programs and program enhancements ("User exits") have a bad performance. The bad performance can be seen when accessing the following sap logistic tables:
Afru, afko, aufk, caufv, resb
Additional key words
Cause and prerequisitesThe R/3 system does not contain secondary indexes to the most important PP/PM flow tables.
To access them extends tively you need a basic knowledge of the SAP data model. This notes contains information on the most important errors and provides alternatives.
However, note the following warnings:
-Before you use the suggested alternatives check your program for functional correctness.
Pay attention to the following notes:
In the following examples, you often find accesses to several
E.G ..:
Select aufnr from resb where rsnum = <afko-rsnum>
Select... from afko where aufnr = <resb-aufnr>
To increase the performance you shoshould define a selection view on the corresponding tables (here: resb and afko) to combine the accesses to both table into one.Solution1. Access to order confirmation (Table afru) a) Search for confirmation of orders (field AFRU-AUFNR ):
Incorrect:
Select from afru where aufnr =...
Correct:
Select aufpl from afko where aufnr = <afru-aufnr>
Select rueck from afvc where aufpl = <afko-aufpl>
Select... from afru where rueck = <afvc-rueck>
Caution:
From table afvc, you receive one value per operation for "rueck ". 2. access to PPS orders (Tables afko, caufv, aufk) a) Find orders for reservation (field AFKO-RSNUM; CAUFV-RSNUM ):
Incorrect:
Select from afko where rsnum =...
Correct:
Select aufnr from resb where rsnum = <afko-rsnum>
Select... from afko where aufnr = <resb-aufnr>
Note:
The same access path applies to caufv and aufk.
Search for sales orders (Tables VBAP-VBELN, VBAP-POSNR; VBFA-VBELN; and so on .)
Incorrect:
Select from aufk where kdauf = <VBAP-VBELN>
And kdpos = VBAP-POSNR>
Correct:
Select from afpo where kdauf = <VBAP-VBELN>
And kdpos = VBAP-POSNR>
Select from aufk where aufnr = AFPO-AUFNR.
Note:
The tables afko and caufv can be selected analogously to the aufk access using Order Number aufnr.3. access to reservations and dependent requirement (Table: resb, mdrs ATP _ resb)) search for reservation for PPS orders (field RESB-AUFNR ):
Incorrect:
Select from resb where aufnr =...
Correct:
Select rsnum from afko where aufnr = <resb-aufnr>
Select... from resb where rsnum = <afko-rsnum>
Note:
The same access path applies to mdrs and atp_resb. B) Search for reservation for planned orders (field RESB-PLNUM ):
Incorrect:
Select from resb where plnum =...
Correct:
Select rsnum from plaf where plnum = <resb-plnum>
Select... from resb where rsnum = <plaf-rsnum>
Note:
The same access path applies to mdrs and atp_resb.