How to improve the performance of MB51
MB51 Logic:
When you execute report MB51 it reads the inventory management tables MSEG & MKPF. When you run the report MB51 it goes into the database and reads 'every' single entry in the tables MSEG & MKPF until it finds the entry that matches the search criteria.
General recommendation:
1. Decrease the number of data fields in view V_MMIM_REP_CUST
In addition to that with report RM07DOCS it is possible to reduce the number of data fields to be processed. Each data field to be processed costs performance. The corresponding customizing view "V_MMIM_REP_CUST" allows to select and decrease the number of data fields from the MM documents. Please have a look at the attached note 357187.
In the standard system this customizing view comprises 56 data fields, which are marked for output. Please have a look at these fields and try to determine the fields you need in any case. Deactivate the output
in view "V_MMIM_REP_CUST" for all fields you do not need. This will improve the performance of MB51 because the volume of the selected data becomes smaller. The number of records is the same but the length of the records become shorter. The internal working tables become leaner, too.
2. Restrict the selections of transaction MB51 for material, plant, posting dates, etc..
3. Start transaction MB51 in background mode
4. Check the database statistics and settings
5. Plan a reorganization of the MM documents
SAP note: 85558 Tables with data sorted by index (see 373465 2010 for the analysis)
6. In transaction MB51 select the option Access with Material.
7. Update statistics on BUDAT field in MKPF regularly as described in SAP Note 821722
821722 Performance of the join on MSEG and MKPF (ONLY for the system runs on Microsoft SQL Server 2000, SQL Server 2005, or SQL Server 2008.)
8. The table ADMI_RUN can be checked using SE16 to see if archiving runs for IM objects have already been performed. This can give an indication if the customer already has an archiving strategy in place. Achiving object MM_MATBEL,MM_SPSTOCK
9. If note 555893 has been implemented, then you can de-activate the colours of the numeric fields with stocks and values in the output list. This reduces the size of the required memory and will be helpful for very large output lists..
Here, for the program RM07DOCS, you have the possibility of setting the 'Without Color' indicator. Please, notice that, according to the F1-on-line-help for this field:
"Note, that the highlighting with colors requires a large amount of performance. SAP recommends deactivating this function if performance problems occur."
SAP OSS Note:
921164 MB51: Runtime improvement using database hints
1360050 MB51: Performance optimization for Oracle databases >> PILOT
Additional correctness:
We have added BREAK-POINT commands that can be activated in the source code of the report RM07DOCS. These should simplify troubleshooting.
Use transaction SAAB to create the checkpoint group MMIM_REP_MB51 with the description "MM-IM reporting report RM07DOCS transaction: MB51" for the package MB.