SD-定价关于Condition is Inactive
在SAP的定价过程中常常出现条件无效状态,我们常常需要分析无效原因。我现在将关于无效状态的一些信息总结如下:
1)SD的定价过程中的无效状态字段(KINAK)
无效状态字段(KINAK)的取值列表如下:
| A | Condition exclusion item | 
| K | Inactive due to calculation basis/shipping material type | 
| L | Condition exclusion header or inactive at header level | 
| M | Inactive due to manual entry | 
| T | Inactive at header level | 
| W | The document item is statistical | 
| X | Inactive via formulas or incorrect | 
| Y | Inactive because of subsequent price | 
2)定价过程的状态字段显示
Condition Screen中 Inactive数据列的图标表示含义如下:
- Red traffic light(红灯): Condition contains errors or is set inactive via a formula.
- Green traffic light(绿灯): Condition is active.
- Amber traffic light(黄灯): Condition is inactive.
- (无图标):Subtotals lines generally do not have traffic lights
关于屏幕显示代码摘抄如下(LV69AF11)
* set icon for KINAK
   IF NOT komv-kschl IS INITIAL.
     DATA: wa_icon TYPE icons.
     CASE komv-kinak.
       WHEN space.
         wa_icon-l2   = '@5B@'.         "ICON_LED_GREEN
         wa_icon-text = text-s01.
       WHEN 'X'.
         wa_icon-l2   = '@5C@'.         "ICON_LED_RED
         wa_icon-text = text-s02.
       WHEN OTHERS.
         wa_icon-l2   = '@5D@'.         "ICON_LED_YELLOW
         wa_icon-text = text-s03.
     ENDCASE.
 *   create icon with quickinfo (tooltip)
     CALL FUNCTION 'ICON_CREATE'
       EXPORTING
         name   = wa_icon-l2
         info   = wa_icon-text
       IMPORTING
         result = rv61a-led_kinak
       EXCEPTIONS
         OTHERS = 3.
     IF sy-subrc <> 0.
       rv61a-led_kinak = wa_icon-l2.
     ENDIF.
   ENDIF.
3)定价过程中是如何设置这些状态
在价格计算函数(Pricing)里,系统通过以下主要逻辑设置无效状态
- 价值为0项目,根据设置无效状态
- 定价过程中设置为统计项目,设置无效状态
- 定价过程中有多个价格,最后一个价格前面的条件都会设置无效
- 定价过程中出现价格计算逻辑错误
代码摘抄如下( LV61AA55):
逻辑1
* inactivate prices with rate / condition value zero
     IF xkomv-koaid EQ 'B' AND xkomv-kbetr EQ 0 AND komp-kposn NE 0 AND                           "koaid: Condition Class= B=>Prices
        xkomv-kgrpe EQ ' ' AND xkomv-kinak CA ' Y' AND xkomv-kwert EQ 0                   "kgrpe: Group Condition
        AND xkomv-kntyp NE 'e' AND komp-fareg NA '45' AND xkomv-val_zero NE 'A'.     "kntyp:Condition Category (Examples: Tax, Freight, Price, Cost)
                                                         "VAL_ZERO: Process Conditions with Value Equal to Zero
       xkomv-kinak = 'X'.
     ENDIF.
  
逻辑2
* inactive all active conditions on items set statistical
     IF xkomv-kschl NE space AND komp-kposn NE 0 AND  
        komp-kaend_typ(1) NE '*' AND
        xkomv-kinak = ' '    AND komp-kowrr NE space.  komp-kowrr =>Statistical Values 
       xkomv-kinak = 'W'.
     ENDIF.
逻辑3
    LOOP AT xkomv.
       IF sy-tabix = letzter_preis.   letzter_preis=最后一个价格条件行的位置,前面的定价都会设置为inactive
         EXIT.
       ENDIF.
 *     exclude quantity adjustment conditions from last price logic
 =>krech = Calculation Type for Condition
       CHECK xkomv-krech NE if_prc_qty_adjustment_constant=>c_calculation_type. "KRECH = 'V'
       IF xkomv-kinak CA ' ' AND xkomv-kschl NE space.
         xkomv-kinak = 'Y'.
         ausschluss_erforderlich = 'X'.
         MODIFY xkomv.
       ENDIF.
     ENDLOOP.
逻辑4
这个原因非常之多,不做列表
4)如何查找条件无效状态的原因
·    First go to header data - > sales tab -> pricing procedure field, check whether your pricing procedure is determined or not.
 ·    go to item data - > condition tab, you will see all the condition types here
 ·    click analysis push button on same screen bottom left side.
 ·    now you will get all the condition types that you are placing in your pricing procedure
 ·    here you will find out where the condition type is active or inactive by expand the condition type and also get the reason on right side.
 ·    and please check your item category in VOV7 , check the field "statistic value" whether you maintain any value.
5)相关SAP Notes:
836243 How condition exclusion works in R/3
217009 217009
以上信息供大家参考。
