Performance: Customer developments in mm/Wm (from SAP note 191492)

Source: Internet
Author: User

SymptomCustomer-specific programs and program enhancements ("User exits") have a poor performance. the poor performance was observed when the following sap mm/Wm tables were accessed: mseg, ltap, Eban, rseg. Reason and prerequisitesHowever, note the following Warnings:
  • Before you productively use the alternatives proposed here, you must carefully check your program with respect to functional correctness.
Pay attention TheFollowing note:
In the following examples you can often find accesses to several tables
Example:
Select * From lein where =...
Select * From ltap where lgnum = LEIN-LGNUM and tanum = LEIN-BTANR
...
It might be more favorable, with regard to the performance, to define a selection view on the corresponding tables (here: lein and ltap) in order to combine accesses to these two tables in one access. Solution1. accesses to transport requestsa) via the storage unit number
Incorrect: select from ltap where vlenr =... oder
Select from ltap where nlenr =...
Correct:
Select from lein where lenum =...
Select from ltap where lgnum = LEIN-LGNUM and
And tanum = LEIN-BTANR
And tapos = LEIN-BTAPS. B) via the SD delivery note
Incorrect: select from ltap where nlpla = LIPS-VBELN
And posnr = LIPS-POSNR.Correct:
Select from vbfa where vbelv = LIPS-VBELN
And posnv = lips-posnr
And vbtyp_n = 'q '.
Select from ltap where lgnum = LIPS-LGNUM
And tanum = VBFA-VBELN
And tapos = VBFA-POSNN.Remark:
This access mode only exists if the transport orders were created on account of deliveries in sales and distribution. In this case the respective Transport orders can be determined via the document flow table vbfa.
The field LTAP-NLPLA is filled with the delivery note number via the dynamic storage bin assignment. this automatic assignment can be deactivated in WM customizing (see movement types in WMS ). this side effect must be considered when field nlpla is used for data selection.2. access to material documentsa) via the purchase order number
Incorrect: select from mseg where ebeln =...
And ebelp =... correct:
Select from ekbe where ebeln = ..
And ebelp =...
And vgabe in (, 9 ).
Select from mseg where distinct Nr = EKBE-BELNR
And mjahr = EKBE-GJAHR
And zeile = EKBE-BUZEI.Remark:
The fiscal year must be specified so that the system has valid tive access possibilities via the primary index. if the fiscal year is missing, the database can no longer into tively use the item number for the search (this is a problem, especially for material documents ents with specified items ). if the operation type vgabe is specified, the values can be additionally restricted to the corresponding goods movements that are relevant. b) via the transport order number
Incorrect: select from mseg where tanum =... correct:
Select from ltap where tanum =...
Select from mseg where mbeln = LTAP-WENUM
And mjahr = <requested year>
And zeile = LTAP-WEPOS.c) via Transfer Requirement
Incorrect: Select mseg where tbnum =... correct:
Select ltbk where tbnum = ....
Select mseg where distinct Nr = LTBK-MBLNR
And mjahr = LTBK-MJAHR.Remark:
All items of the material document are returned. It is possible to have a restriction to one individual item of the material document by specifying the material number. d) via the vendor number
Incorrect: select from mseg where lifnr =... correct:
Select Ekko where lifnr = ....
Select ekbe where ebeln = EKKO-EBELN
And vgabe = '1 '.
Select mseg where distinct Nr = EKBE-BELNR
And mjahr = EKBE-GJAHR
And zeile = EKBE-BUZEI.Remark:
Accesses to Ekko and ekbe return several datasets under certain circumstances. This must be taken into account in the program logic. With the operation type vgabe = 1, only goods movements for purchase orders are selected.
As an alternative you can use matchcode object m_mekkl in place of table Ekko (for example select from m_ekkl where lifnr = ...). access can be improved by specifying additional restrictions. the fields purchasing organization ekorg, purchasing group ekgrp, document date bedat, Purchasing Document category bstyp, order type bsart can make the access more selective.3. accesses to purchase requisitionsa) via the reservation number
Incorrect: select from Eban Where ebeln = ....
And ebelp = ....
Correct:
Select from eket where ebeln = ....
Ebelp = ....
Selet from Eban Where banfn = EKET-BANFN
And banfpo = EKET-BANFPO.4. Access to incoming invoicesa) via the purchase order number
Incorrect: select from rseg where ebeln =...
And ebelp =... correct: select from ekbe where ebeln =...
And ebelp =...
And vgabe in (2, 3, P ).
Select from rseg where belnr = EKBE-BELNR
And gjahr = EKBE-GJAHR
And buzei = EKBE-BUZEI.Remark:
By specifying transaction type vgabe, the values are restricted to the relevant goods movements. With gjahr and buzei, the primary index is completely utilized by rseg.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.