sd--如何控制定价条件根据用户不同而操作不同(有的可以输入有的不可以)
2008-01-20 00:20
489 查看
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
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
相关文章推荐
- sd--如何控制定价条件根据用户不同而操作不同(有的可以输入有的不可以)
- sd--如何控制定价条件根据用户不同而操作不同(有的可以输入有的不可以)
- sd--如何控制定价条件根据用户不同而操作不同(有的可以输入有的不可以)
- 如何进行定义特性(Attribute),并且在程序中如何检索定义的特性,可以根据用户定义的不同特性进行不同的操作。
- 如何编写一条SQL实现根据某个字段的条件对某个字段进行不同的update操作
- 用户可以根据自己输入的地址下载网络上的图片和网页信息
- 如何使DataGrid(Web)的不同行根据不同的条件有不同的显示格式?
- [转]给你一个单词a,如果通过交换单词中字母的顺序可以得到另外的单词b,那么定义b是a的兄弟单词。现在给你一个字典,用户输入一个单词,让你根据字典找出这个单词有多少个兄弟单词
- 给你一个单词a,如果通过交换单词中字母的顺序可以得到另外的单词b,那么定义b是a的兄弟单词。现在给你一个字典,用户输入一个单词,让你根据字典找出这个单词有多少个兄弟单词。
- 制作一个控制台小程序,要求:用户可以在控制到录入学生的姓名,当用户输入quit(不区分大小写)时,程序停止接收用户输入,并且显示出学生个数及姓名
- 如何使用PLSQL添加用户和密码,登录时可以免输入密码 PLSQL配置新数据库连接
- 用户输入行数,控制输出形成下三角,并保证每行的数值不同
- vue-router如何根据不同的用户给不同的权限
- 如何根据DataGridView的状态控制是否可以滚动
- [zz]如何控制ftp用户可以切换到ftp home目录的上级目录
- Log4j如何控制不同包的输入级别
- Linux根据不同用户如何设置不同JDK版本
- 根据用户的选择输入判断是哪种水果并加上不同颜色
- combox如何根据下拉框执行不同的操作
- 如何根据业务比例设定不同业务的用户比例?