Symptom
Customer-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 Prerequisites
However, 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 to the following 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.
Solution
1. Accesses to transport requests
a) 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 documents
a) via the purchase order number
Incorrect: SELECT FROM MSEG WHERE EBELN = ...
and EBELP = ...Correct:
SELECT FROM EKBE WHERE EBELN = ..
AND EBELP = ...
AND VGABE IN (1,6,7,8,9).
SELECT FROM MSEG WHERE MBLNR = EKBE-BELNR
AND MJAHR = EKBE-GJAHR
AND ZEILE = EKBE-BUZEI.
Remark:
The fiscal year must be specified so that the system has effective access possibilities via the primary index.If the fiscal year is missing, the database can no longer effectively use the item number for the search (this is a problem, especially for material documents with many 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 MBLNR = 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 MBLNR = 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 requisitions
a) 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 invoices
a) 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.
分享到:
相关推荐
该文档来自于Senior Member of Technical Staff @ Hortonworks Ted Yu在2014中国大数据技术大会主会的演讲“Recent Developments in Apache Hbase”。
Cultural diversity and learning efficiency: Recent developments in assessment. New York: Macmillan, 192 pp., 29.50 Psychologv in rhe Schw[s Volume 29, January 1992 B O O K R E V I E W S ...
本章节将基于《Particle Image Velocimetry: New Developments and Recent Applications》一书中的部分内容,详细介绍PIV技术的基本原理、最新的发展动态以及其在实际工程问题中的应用案例。 #### 二、粒子图像测速...
Idea Group - Recent Developments in Biologically Inspired Computing
储粮害虫的检测技术是确保粮食安全的重要环节,涉及到从收获、加工到最终消费的各个环节。在国际进出口检验检疫、国内存储及供应链管理中,快速、可靠且简便的检测手段尤为关键。目前,已经应用了一系列技术,如探针...
在VMworld 2009大会上,SS5240专题演讲主要探讨了工程开发如何推动虚拟数据中心的发展。这场演讲由来自Cisco、EMC和VMware的专家共同主持,包括Cisco的VP/CTO Ed Bugnion,EMC的VP Chad Sakac以及VMware Office of ...
在2009年的VMworld大会上,SS5240专题演讲主要探讨了工程开发如何推动虚拟数据中心的发展。这场演讲由VMware、Cisco和EMC的专家共同参与,旨在展示和讨论虚拟化技术如何重塑数据中心的架构,以及如何构建更安全、...
标题“Developments in Antenna Analysis and Design Volume 2.pdf”表明本文档是关于天线分析和设计领域的进展的第二卷内容。描述中提及的“天线分析和设计的发展2”进一步强调了该文档将深入探讨天线技术领域的...
Welcome to Sams Teach Yourself TCP/IP in 24 Hours, Fifth Edition. This book provides a clear and concise introduction to TCP/IP for newcomers, and also for users who have worked with TCP/IP but would ...
### 新加密学发展中的关键知识点 #### 一、概述 在《新加密学发展》这一主题下,我们探讨了加密学领域的一些最新进展和技术。本文将深入解析几个核心概念,包括加密协议、公钥基础设施(PKI)、安全网络协议、加密...
### 近期实分析与调和分析的发展 #### 核心知识点概述 《近期实分析与调和分析的发展》一书旨在纪念Carlos Segovia在该领域的杰出贡献,并汇集了多位专家对该领域最新进展的研究成果。该书由Carlos Cabrelli和Jos...
根据给定文件的信息,我们可以提炼出以下关于"SAP BC460 SAPscript: Form Printing and Text Management"的相关知识点。 ### SAP BC460 概述 SAP BC460 是一个专注于SAPscript表单打印和文本管理的模块。该模块...
助听器技术介绍 商用助听器
(2019,FSB,金融稳定委员会)【重点阅读】_FinTech and market structure in financial services_Market developments and potential financial stability implications.pdf
项目:TCA开发网站一,概述内容描述: TCA Developments&Consultant Ltd. 是一家总承包公司,专门从事商业建筑和装修。 作者: Tristan Deane 网址: : 当前版本: 0.12二。 分析与设计我受命改造TCA的现有网站。 ...