SAP SD定價技術分析 - Part I 1) 定價程式 FunctionPool: SAPLV61A Function Name: Pricing 2) 變數說明 XKOMV 記錄系統定價結果(Item Level) TKOMV 記錄系統定價結果(Doc. Level) KOMT1 定價過程 KOMT2 訪問順序 KOMK 定價關鍵字(表頭) KOMP 定價關鍵字(行) 3) 程式處理邏輯 A) 整理 KOMK / KOMP 的值 (SAP提供介面做增強,SO/DN/BILLING) SO: Program: MV45AFZZ User Exit: userexit_pricing_prepare_tkomk / userexit_pricing_prepare_tkomp DN: BADI: LE_SHP_PRICING Method: CHANGE_INPUT_HEADER_AND_ITEMS BILLING: Program: RV60AFZZ User Exit: USEREXIT_PRICING_PREPARE_TKOMK / USEREXIT_PRICING_PREPARE_TKOMP B) 抓取定價IMG的相關設定 Program: LV61AA12 FORM: KONDITIONSVORSTEP -------------------------------------------------------------------------------- * --> KOMK header communication structure * * <-- KOMT1 table of pricing procedure * * <-- KOMT2 table of condition access sequences * -------------------------------------------------------------------------------- C) 根據定價設定,整理定價過程結果內表 Program: LV61AA67 FORM: XKOMV_AUFBAUEN_AUS_KOMT1 -------------------------------------------------------------------------------- * Build XKOMV from KOMT1 derived from T683S * -------------------------------------------------------------------------------- * --> KOMK header communication structure * * --> KOMP item communication structure * * --> KOMT1 pricing procedure * * --> KOMT2 accesses * * <-- XKOMV internal table of conditions * -------------------------------------------------------------------------------- 定價過程中的"需求"將在這裡被處理. 如果檢查通過的話,改定價類型將會被記錄在XKOMV裡面. 價格主檔的資料也會在這裡被處理,見 Program: LV61AA29 FORM: konditionen_lesen D) 根據TKOMV整理XKOMV定價過程結果內表 Program: LV61AA58 FORM: XKOMV_AUFBAUEN_AUS_TKOMV -------------------------------------------------------------------------------- * Build XKOMV from TKOMV * -------------------------------------------------------------------------------- * --> KOMT1 pricing procedure * * --> TKOMV complete table of conditions * * <-- XKOMV internal table of conditions * -------------------------------------------------------------------------------- E) 定價過程內表的計算(處理Formula,subtotal,base value ...) Program: LV61AA55 FORM: XKOMV_BEWERTEN -------------------------------------------------------------------------------- * Calculate on internal table of conditions * -------------------------------------------------------------------------------- * --> PREISFINDUNGSART pricing type * * --> KOMK header communication structure * * <-> KOMP item communication structure * * <-> XKOMV internal table of conditions * * <-> GKOMV table of group conditions pricing type F only * * --> GKOMZ table of group cond indeces pricing type F only *F) 根據表T684的記錄,執行定價排斥 Program: LV61AA56 FORM: XKOMV_AUSSCHLUSS 可參考 SAP NOTES: 836243 G) 將XKOMV的結果整理到TKOMV Program: LV61AA42 FORM: XKOMV_UEBERTRAGEN_NACH_TKOMV -------------------------------------------------------------------------------- * Transfer XKOMV to TKOMV * -------------------------------------------------------------------------------- * --> XKOMV table document conditions * * <-- TKOMV table all document conditions * -------------------------------------------------------------------------------- 4) 有關定價的一些SAP NOTES. 1165078 Authorization check for conditions or subtotals 1007110 How is the KWERT determined in a subtotal? 836243 How condition exclusion works in R/3 791944 How is the KBETR determined in a subtotal? 485740 Conditions with fixed amount in copy activities 201830 Calculation of the net price of an item 154529 Pricing in the delivery 130417 Pricing preparation in billing document (user exit) 92090 Exclusion indicator KZNEP 67958 Mode of operation of the condition exclusion 41490 Condition exclusion (KZNEP) 24832 Pricing rules / TVCPF 18173 Minimum order value 900089 Pricing: Processing steps FORM XKOMV_BEWERTEN 363212 'Pricing analysis' mode of operation By hui yang -------------------------------------------------------------------------------- 小計/計算類型/基礎類型 在這裡被處理. 可參考 SAP NOTES: 900089,有詳細描述處理邏輯.