调用的方法
*&---------------------------------------------------------------------*
*& Form USEREXIT_CHECK_VBAK
*&---------------------------------------------------------------------*
* *
* This Userexit can be used to add additional logic for *
* checking the header for completeness and consistency. *
* *
* US_DIALOG - Indicator, that can be used to suppress *
* dialogs in certain routines, e.g. in a *
* copy routine. *
* *
* This form is called from form VBAK_PRUEFEN. *
* *
*---------------------------------------------------------------------*
form userexit_check_vbak using us_dialog.
*{ INSERT DEVK901354 1
data: z_s_vkbur like knvv-vkbur.
data: z_auth_check type i value 4.
if sy-tcode = 'VA01' or
sy-tcode = 'VA02'.
authority-check object 'V_VBKA_VKO'
id 'VKORG' dummy
id 'VTWEG' dummy
id 'SPART' dummy
id 'VKBUR' field vbak-vkbur
id 'VKGRP' dummy
id 'KTAAR' dummy
id 'ACTVT' dummy.
if sy-subrc ne 0.
message e900(zdev).
endif."不能创建非主管商家订单
if sy-tcode eq 'VA01'.
select single vkbur into z_s_vkbur
from knvv
where knvv~kunnr = vbak-kunnr
and knvv~vkorg = vbak-vkorg
and knvv~vtweg = vbak-vtweg
and knvv~spart = vbak-spart
and knvv~vkbur = vbak-vkbur.
if sy-subrc ne 0.
message e001(zdev).
endif.
endif.
else.
perform zcustcheckauth using vbak-vkbur z_auth_check.
if z_auth_check ne 0. "如果没有权限,取当前商家主管销售组
select single vkbur into z_s_vkbur
from knvv
where knvv~kunnr = vbak-kunnr.
if sy-subrc ne 0.
message e001(zdev).
endif. "检查当前商家主管销售组是否在用户权限内
z_auth_check = 4.
perform zcustcheckauth using z_s_vkbur z_auth_check.
if z_auth_check ne 0.
message e900(zdev).
endif.
endif.
endif.
*} INSERT
endform.
*& Form USEREXIT_CHECK_VBAK
*&---------------------------------------------------------------------*
* *
* This Userexit can be used to add additional logic for *
* checking the header for completeness and consistency. *
* *
* US_DIALOG - Indicator, that can be used to suppress *
* dialogs in certain routines, e.g. in a *
* copy routine. *
* *
* This form is called from form VBAK_PRUEFEN. *
* *
*---------------------------------------------------------------------*
form userexit_check_vbak using us_dialog.
*{ INSERT DEVK901354 1
data: z_s_vkbur like knvv-vkbur.
data: z_auth_check type i value 4.
if sy-tcode = 'VA01' or
sy-tcode = 'VA02'.
authority-check object 'V_VBKA_VKO'
id 'VKORG' dummy
id 'VTWEG' dummy
id 'SPART' dummy
id 'VKBUR' field vbak-vkbur
id 'VKGRP' dummy
id 'KTAAR' dummy
id 'ACTVT' dummy.
if sy-subrc ne 0.
message e900(zdev).
endif."不能创建非主管商家订单
if sy-tcode eq 'VA01'.
select single vkbur into z_s_vkbur
from knvv
where knvv~kunnr = vbak-kunnr
and knvv~vkorg = vbak-vkorg
and knvv~vtweg = vbak-vtweg
and knvv~spart = vbak-spart
and knvv~vkbur = vbak-vkbur.
if sy-subrc ne 0.
message e001(zdev).
endif.
endif.
else.
perform zcustcheckauth using vbak-vkbur z_auth_check.
if z_auth_check ne 0. "如果没有权限,取当前商家主管销售组
select single vkbur into z_s_vkbur
from knvv
where knvv~kunnr = vbak-kunnr.
if sy-subrc ne 0.
message e001(zdev).
endif. "检查当前商家主管销售组是否在用户权限内
z_auth_check = 4.
perform zcustcheckauth using z_s_vkbur z_auth_check.
if z_auth_check ne 0.
message e900(zdev).
endif.
endif.
endif.
*} INSERT
endform.