sap 隐式增强 系统升级后会覆盖么
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sap 隐式增强 系统升级后会覆盖么相关的知识,希望对你有一定的参考价值。
SAP有四代增强:第一代: user exit(需要access key, 现在一般不用这种增强了)
第二代: customer exit
第三代: BADI
第四代: Framework(显式增强, 隐式增强)
个人认为BADI是最好用的, customer exit也会经常用到, 隐式增强功能很强大,需要一定的debug技巧。
其他增强还有BTE, validation, substitution这些可能FI模块用得比较多 参考技术A 一代增强升级会被覆盖,四代不会覆盖。
如何根据用户权限屏蔽或显示SAP的订单中的成本显示
程序目的说明:1、 SAP标准程序不能在销售订单(va01 va02 va03)中根据权限显示或不显示有些订单定价过程的敏感数据。
2、 由于公司需要对销售订单定价过程的敏感数据(如成本数据)进行控制,因此需要增强系统功能,使系统能根据用户权限和定价敏感数据的设置来决定显示或不显示定价过程中的订单定价过程的敏感数据。
3、 修改了LV69AFZZ的userexit_field_modific_leer
userexit_field_modific_kzwi
userexit_field_modific_kopf
userexit_field_modification
四个用户出口。
程序代码:
源程序:红色为新增代码
*----------------------------------------------------------------------*
***INCLUDE LV69AFZZ .
*----------------------------------------------------------------------*
* INSERT DEVK901084 1
data: OLD_KOMV like komv.
data: OLD_KOMk like komk.
data: z_auth_subrc like sy-subrc.
DATA : i_zauthprice TYPE STANDARD TABLE OF zauthprice
WITH HEADER LINE.
data: Z_S(60) type c,
z_s1(10) type c.
* INSERT
*&---------------------------------------------------------------------*
*& Form USEREXIT_FIELD_MODIFIC_LEER
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form userexit_field_modific_leer.
* INSERT DEVK901084 1
z_auth_subrc = 4.
IF screen-name = \'FCODE\'.
CLEAR old_komk.
ENDIF.
AUTHORITY-CHECK OBJECT \'K_ZKALSM\'
ID \'KALSM\' FIELD komk-kalsm
ID \'ACTVT\' DUMMY.
z_auth_subrc = sy-subrc.
if sy-TCODE =\'VA03\'.
z_auth_subrc = 4.
endif.
old_komk = komk.
old_komv = komv.
REFRESH i_zauthprice.
CLEAR i_zauthprice.
SELECT * FROM zauthprice
INTO CORRESPONDING FIELDS OF TABLE i_zauthprice
WHERE zauthprice~kalsm = komk-kalsm.
IF z_auth_subrc NE 0.
READ TABLE i_zauthprice WITH KEY stunr = komv-stunr BINARY SEARCH.
IF sy-subrc = 0.
IF ( screen-name = \'RV61A-SELKZ\'
OR screen-name = \'KOMV-KAWRT\'
OR screen-name = \'RV61A-AWEIN\'
OR screen-name = \'KOMV-KBETR\'
OR screen-name = \'RV61A-KOEIN\'
OR screen-name = \'KOMV-KPEIN\'
OR screen-name = \'KOMV-KMEIN\'
OR screen-name = \'KOMV-KWERT\' ).
screen-active = 0.
ENDIF.
ENDIF.
ENDIF.
move z_auth_subrc to Z_S1.
CONCATENATE \'userexit_field_modific_leer Control:\' z_s1 into Z_S.
MESSAGE Z_S TYPE \'W\'.
MODIFY SCREEN.
* INSERT
endform. " USEREXIT_FIELD_MODIFIC_LEER
*&---------------------------------------------------------------------*
*& Form USEREXIT_FIELD_MODIFIC_KZWI
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form userexit_field_modific_kzwi.
* INSERT DEVK901084 1
z_auth_subrc = 4.
IF screen-name = \'FCODE\'.
CLEAR old_komk.
ENDIF.
AUTHORITY-CHECK OBJECT \'K_ZKALSM\'
ID \'KALSM\' FIELD komk-kalsm
ID \'ACTVT\' DUMMY.
z_auth_subrc = sy-subrc.
if sy-TCODE =\'VA03\'.
z_auth_subrc = 4.
endif.
old_komk = komk.
old_komv = komv.
REFRESH i_zauthprice.
CLEAR i_zauthprice.
SELECT * FROM zauthprice
INTO CORRESPONDING FIELDS OF TABLE i_zauthprice
WHERE zauthprice~kalsm = komk-kalsm.
IF z_auth_subrc NE 0.
READ TABLE i_zauthprice WITH KEY stunr = komv-stunr BINARY SEARCH.
IF sy-subrc = 0.
IF ( screen-name = \'RV61A-SELKZ\'
OR screen-name = \'KOMV-KAWRT\'
OR screen-name = \'RV61A-AWEIN\'
OR screen-name = \'KOMV-KBETR\'
OR screen-name = \'RV61A-KOEIN\'
OR screen-name = \'KOMV-KPEIN\'
OR screen-name = \'KOMV-KMEIN\'
OR screen-name = \'KOMV-KWERT\' ).
screen-active = 0.
ENDIF.
ENDIF.
ENDIF.
move z_auth_subrc to Z_S1.
CONCATENATE \'userexit_field_modific_kzwi Control:\' z_s1 into Z_S.
MESSAGE Z_S TYPE \'W\'.
MODIFY SCREEN.
* INSERT
endform. " USEREXIT_FIELD_MODIFIC_KZWI
*&---------------------------------------------------------------------*
*& Form USEREXIT_FIELD_MODIFIC_KOPF
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form userexit_field_modific_kopf.
* INSERT DEVK901084 1
z_auth_subrc = 4.
IF screen-name = \'FCODE\'.
CLEAR old_komk.
ENDIF.
AUTHORITY-CHECK OBJECT \'K_ZKALSM\'
ID \'KALSM\' FIELD komk-kalsm
ID \'ACTVT\' DUMMY.
z_auth_subrc = sy-subrc.
if sy-TCODE =\'VA03\'.
z_auth_subrc = 4.
endif.
old_komk = komk.
old_komv = komv.
REFRESH i_zauthprice.
CLEAR i_zauthprice.
SELECT * FROM zauthprice
INTO CORRESPONDING FIELDS OF TABLE i_zauthprice
WHERE zauthprice~kalsm = komk-kalsm.
IF z_auth_subrc NE 0.
READ TABLE i_zauthprice WITH KEY stunr = komv-stunr BINARY SEARCH.
IF sy-subrc = 0.
IF ( screen-name = \'RV61A-SELKZ\'
OR screen-name = \'KOMV-KAWRT\'
OR screen-name = \'RV61A-AWEIN\'
OR screen-name = \'KOMV-KBETR\'
OR screen-name = \'RV61A-KOEIN\'
OR screen-name = \'KOMV-KPEIN\'
OR screen-name = \'KOMV-KMEIN\'
OR screen-name = \'KOMV-KWERT\' ).
screen-active = 0.
ENDIF.
ENDIF.
ENDIF.
move z_auth_subrc to Z_S1.
CONCATENATE \'userexit_field_modific_kopf Control:\' z_s1 into Z_S.
MESSAGE Z_S TYPE \'W\'.
MODIFY SCREEN.
* INSERT
endform. " USEREXIT_FIELD_MODIFIC_KOPF
*&---------------------------------------------------------------------*
*& Form USEREXIT_FIELD_MODIFICATION
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form userexit_field_modification.
* INSERT DEVK901084 1
z_auth_subrc = 4.
IF screen-name = \'FCODE\'.
CLEAR old_komk.
ENDIF.
AUTHORITY-CHECK OBJECT \'K_ZKALSM\'
ID \'KALSM\' FIELD komk-kalsm
ID \'ACTVT\' DUMMY.
z_auth_subrc = sy-subrc.
if sy-TCODE =\'VA03\'.
z_auth_subrc = 4.
endif.
old_komk = komk.
old_komv = komv.
REFRESH i_zauthprice.
CLEAR i_zauthprice.
SELECT * FROM zauthprice
INTO CORRESPONDING FIELDS OF TABLE i_zauthprice
WHERE zauthprice~kalsm = komk-kalsm.
IF z_auth_subrc NE 0.
READ TABLE i_zauthprice WITH KEY stunr = komv-stunr BINARY SEARCH.
IF sy-subrc = 0.
IF ( screen-name = \'RV61A-SELKZ\'
OR screen-name = \'KOMV-KAWRT\'
OR screen-name = \'RV61A-AWEIN\'
OR screen-name = \'KOMV-KBETR\'
OR screen-name = \'RV61A-KOEIN\'
OR screen-name = \'KOMV-KPEIN\'
OR screen-name = \'KOMV-KMEIN\'
OR screen-name = \'KOMV-KWERT\' ).
screen-active = 0.
ENDIF.
ENDIF.
ENDIF.
move z_auth_subrc to Z_S1.
CONCATENATE \'userexit_field_modification Control:\' z_s1 into Z_S.
MESSAGE Z_S TYPE \'W\'.
MODIFY SCREEN.
* INSERT
endform. " USEREXIT_FIELD_MODIFICATION
*&---------------------------------------------------------------------*
*& Form USEREXIT_PRICING_CHECK
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form userexit_pricing_check.
* INSERT DEVK901084 1
include zsde0002.
* INSERT
endform. " USEREXIT_PRICING_CHECK
*&---------------------------------------------------------------------*
*& Form USEREXIT_CHANGE_PRICING_RULE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_RV61A_KSTEU text
*----------------------------------------------------------------------*
form userexit_change_pricing_rule using p_rv61a_ksteu.
endform. " USEREXIT_CHANGE_PRICING_RULE 参考技术A http://blog.csdn.net/sap_jack/article/details/1066287
以上是关于sap 隐式增强 系统升级后会覆盖么的主要内容,如果未能解决你的问题,请参考以下文章
[SAP BASIS]SAP BASIS 升级的stack文件解析