Symptom
Customer-specific programs and program enhancements ("User Exits") have a bad performance. The bad performance is noticed during accesses to the following SAP SD tables: VBAK, VBAP, VMVA, LIKP, LIPS, VBRK, VBRP, VBFA
Additional key words Cause and prerequisites
The R/3 System contains no secondary indexes to the most important SD transaction data tables in the delivery. Instead, the R/3 System has proprietary index tables (sales document indexes, for example the tables VAKPA and VAPMA, matchcode tables for example M_VMVAB, M_VMVAC or matchcode views for example M_VMVAA, M_VMVAE), which allow an efficient access.
In order to use these efficiently a certain basic knowledge of the SAP data model is required. For this this note lists the most important errors which are made and it offers alternatives.
However note the following WARNINGS:
- Before you use the listed alternatives productively, you must check your program closely for functional accuracy.
- The sales document indexes must be maintained correctly in your system. This is usually automatically the case, however, there can be inconsistencies. Carefully read and follow Notes 128947 and 178328.
Consider the following NOTES:
In the following examples, there are often accesses to several tables, for example:
SELECT FROM vakpa WHERE kunde = ... SELECT FROM vbak WHERE vbeln = vakpa-vbeln.
It can increase the performance, to define a selection view on the corresponding tables (here: VAKPA and VBAK) in order to combine the accesses to the two tables in one access.
Solution
1. Accesses to sales orders (tables VBAK, VBAP)
a) Search orders for customer number (field VBAK-KUNNR):
Incorrect: SELECT FROM vbak WHERE kunnr = ...
Correct: SELECT FROM vakpa WHERE kunde = ...
SELECT FROM vbak WHERE vbeln = vakpa-vbeln.
b) Search order items for material number (field VBAP-MATNR):
Incorrect: SELECT FROM vbap WHERE matnr = ...
Correct: SELECT FROM vapma WHERE matnr = ... SELECT FROM vbap WHERE vbeln = vapma-vbeln
AND posnr = vapma-posnr
c) Other search helps for sales orders offer the matchcode tables and views M_VMVAx, x. = A, B, C, ... M; for example search for purchase order number of the customer, description and so on
2. Accesses to deliveries (tables LIKP, LIPS)
a) Search for deliveries with customer number (field LIKP-KUNNR):
Incorrect: SELECT FROM likp WHERE kunnr = ...
Correct: SELECT FROM vlkpa WHERE kunde = ... SELECT FROM likp WHERE vbeln = vlkpa-vbeln.
b) Search for delivery items with material number (field LIKP-MATNR):
Incorrect: SELECT FROM lips WHERE matnr = ...
Correct: SELECT FROM vlpma WHERE matnr = ... SELECT FROM lips WHERE vbeln = vlpma-vbeln
AND posnr = vlpma-posnr
c) Search for deliveries with sales order number (preceding document, field LIPS-VGBEL):
Incorrect: SELECT FROM lips WHERE vgbel = ...
Correct: SELECT FROM vbfa WHERE VBELV = ... and VBTYP_N = 'J' SELECT FROM lips WHERE vbeln = vbfa-vbeln
AND posnr = vbfa-posnn
d) Other search helps for deliveries offer matchcode tables and views M_VMVLx, x. = A, B, C, ... M; for example search for goods issue date, picking date, transportation planning date and so on.
3. Accesses to invoices (tables VBRK, VBRP)
a) Search for invoices with customer number ("payer") (field VBRK-KUNRG):
Incorrect: SELECT FROM vbrk WHERE kunrg = ...
Correct: SELECT FROM vrkpa WHERE kunde = ... SELECT FROM vbrk WHERE vbeln = vrkpa-vbeln
b) Search for invoice items with material number (field VBRP-MATNR):
Incorrect: SELECT FROM vbrp WHERE matnr = ...
Correct: SELECT FROM vrpma WHERE matnr = ... SELECT FROM vbrp WHERE vbeln = vrpma-vbeln
AND posnr = vrpma-posnr
c) Search for invoices with delivery number (preceding document, field VBRP-VGBEL):
Incorrect: SELECT FROM vbrp WHERE vgbel = ...
Correct: SELECT FROM vbfa WHERE vbtyp_n = 'M'
AND vbelv = ... SELECT FROM vbrp WHERE vbeln = vbfa-vbeln
AND posnr = vbfa-posnn
d) Search for invoices with order number (preceding document, field VBRP-AUBEL):
Incorrect: SELECT FROM vbrp WHERE aubel = ...
Correct: SELECT FROM vbfa WHERE vbtyp_n = 'M' AND vbelv = ...
SELECT FROM vbrp WHERE vbeln = vbfa-vbeln
AND posnr = vbfa-posnn
4. Other accesses in SD:
a) Document flow:
Incorrect: SELECT vbelv FROM vbfa WHERE vbeln ...
In table VBFA only the preceeding document is used to search for the subsequent document (for example, delivery for order). Searching the other way makes no sense with this table since the preceding documents (for example, order for delivery) are stored directly in the document tables. Thus reading in table VBFA is a one-way street.
Correct: SELECT vgbel FROM lips WHERE vbeln = ...; or SELECT vgbel FROM vbrp WHERE vbeln = ...; or
SELECT aubel FROM vbrp WHERE vbeln = ...
b) Search for shipping unit item with delivery
Incorrect: SELECT FROM vepo WHERE vbtyp = 'J' AND vbeln = i_lips-vbeln
Correct: SELECT FROM vbfa WHERE vbtyp_n = 'X' AND vbelv = i_lips-vbeln
SELECT FROM vepo WHERE venum = vbfa-vbeln
相关连接:
http://blog.csdn.net/CompassButton/archive/2007/01/26/1494627.aspx
分享到:
相关推荐
该文档来自于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技术的基本原理、最新的发展动态以及其在实际工程问题中的应用案例。 #### 二、粒子图像测速...
储粮害虫的检测技术是确保粮食安全的重要环节,涉及到从收获、加工到最终消费的各个环节。在国际进出口检验检疫、国内存储及供应链管理中,快速、可靠且简便的检测手段尤为关键。目前,已经应用了一系列技术,如探针...
在VMworld 2009大会上,SS5240专题演讲主要探讨了工程开发如何推动虚拟数据中心的发展。这场演讲由来自Cisco、EMC和VMware的专家共同主持,包括Cisco的VP/CTO Ed Bugnion,EMC的VP Chad Sakac以及VMware Office of ...
在2009年的VMworld大会上,SS5240专题演讲主要探讨了工程开发如何推动虚拟数据中心的发展。这场演讲由VMware、Cisco和EMC的专家共同参与,旨在展示和讨论虚拟化技术如何重塑数据中心的架构,以及如何构建更安全、...
Idea Group - Recent Developments in Biologically Inspired Computing
标题“Developments in Antenna Analysis and Design Volume 2.pdf”表明本文档是关于天线分析和设计领域的进展的第二卷内容。描述中提及的“天线分析和设计的发展2”进一步强调了该文档将深入探讨天线技术领域的...
### 近期实分析与调和分析的发展 #### 核心知识点概述 《近期实分析与调和分析的发展》一书旨在纪念Carlos Segovia在该领域的杰出贡献,并汇集了多位专家对该领域最新进展的研究成果。该书由Carlos Cabrelli和Jos...
项目:TCA开发网站一,概述内容描述: TCA Developments&Consultant Ltd. 是一家总承包公司,专门从事商业建筑和装修。 作者: Tristan Deane 网址: : 当前版本: 0.12二。 分析与设计我受命改造TCA的现有网站。 ...
(2019,FSB,金融稳定委员会)【重点阅读】_FinTech and market structure in financial services_Market developments and potential financial stability implications.pdf
助听器技术介绍 商用助听器
根据给定文件的信息,我们可以提炼出以下关于"SAP BC460 SAPscript: Form Printing and Text Management"的相关知识点。 ### SAP BC460 概述 SAP BC460 是一个专注于SAPscript表单打印和文本管理的模块。该模块...
Carbohydrates on cell surfaces play a crucial role in a wide variety of biological processes, including cell adhesion, recognition and signaling, viral and bacterial infection, inflammation and ...
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 ...
In the past two decades, two-photon microscopy (TPM) transforms biomedical research, allowing nondestructive high-resolution fluorescent molecular imaging and label-free imaging in vivo and in real ...