zoukankan      html  css  js  c++  java
  • sd如何控制定价条件根据用户不同而操作不同(有的可以输入有的不可以)

    Often there is a requirement for making a condition type (price, discount etc) non-modifiable for some-users and modifiable for others using the same SAP system or modifiable for certain document types (say OR ie Standard Sales Order) and non-modifiable in another order type (say CR ie Credit Memo Request). In standard SAP this is not possible. Using the controls for the condition-type (V/06 transaction) we can either make a condition type 

    1.       No Limitations

    2.       A : Free

    3.       B : Automatic Entry has Priority

    4.       C : Manual Entry has Priority

    5.       D : Not possible to process manually 

    Selecting any one of this option makes the condition type uniform across all document type and for users. Often the requirements are like for a group of users the condition type should behave like C option, for another group like D or for a specific document type it should be A and for others D. 

    One of the easiest way to achieve this is through the user-exit USEREXIT_PRICING_PREPARE_TKOMP in the include MV45AFZZ. 

    The following code will make the condition type PR00 modifiable for user ABAP1 and non-modifiable for all other users. 


    FORM USEREXIT_PRICING_PREPARE_TKOMP.
     
    DATA : i_T685A TYPE STANDARD TABLE OF T685A WITH HEADER LINE.
     
    IF SY-UNAME = 'ABAP1'.
    LOOP AT XKOMV.
    IF XKOMV-KSCHL = 'PR00'.
    SELECT * FROM T685A INTO TABLE I_T685A WHERE KSCHL = 'PR00'.
    READ TABLE I_T685A WITH KEY KSCHL = XKOMV-KSCHL.
    I_T685A-KMANU = 'C'.
    MODIFY I_T685A INDEX SY-TABIX.
    MODIFY T685A FROM TABLE I_T685A.
    REFRESH I_T685A.
    ENDIF.
     
    ENDLOOP.
     
    ELSE.
    LOOP AT XKOMV.
    IF XKOMV-KSCHL = 'PR00'.
    SELECT * FROM T685A INTO TABLE I_T685A WHERE KSCHL = 'PR00'.
    READ TABLE I_T685A WITH KEY KSCHL = XKOMV-KSCHL.
    I_T685A-KMANU = 'D'.
    MODIFY I_T685A INDEX SY-TABIX.
    MODIFY T685A FROM TABLE I_T685A.
    REFRESH I_T685A.
    ENDIF.
    ENDLOOP.
     
    ENDIF.
     
    ENDFORM.

     url:https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/7879
  • 相关阅读:
    数据结构之树和二叉树的一些基本概念
    面向对象的三大特点
    WOJ 1020
    C++ STL copy函数效率分析
    局部特化和类模板成员特化
    局部特化 & 特化
    back_inserter 与 iterator
    new期间的异常
    数组分配
    placement new和delete
  • 原文地址:https://www.cnblogs.com/xiaomaohai/p/6157104.html
Copyright © 2011-2022 走看看