2011年3月30日 星期三

[SD] How to comparing Partners address at creating Order

User Exit: MV45AFZB
IF ( VBAK-VKORG = '1000' OR
VBAK-VKORG = '2000' ) AND
( SY-TCODE = 'VA01' OR
SY-TCODE = 'VA02' ) AND
VBAK-VBTYP = 'C' AND " SD Order
VBAK-VGTYP = 'G'. " Reference to Contract
READ TABLE XVBPA WITH KEY PARVW = 'WE'. " WE: Ship-to party
READ TABLE XVBADR WITH KEY ADRNR = XVBPA-ADRNR.
IF XVBPA-UPDKZ = 'U' OR " U: New Ship-to
XVBADR-UPDKZ NE ''. " Data Modified (U) or Added (I)
AUTHORITY-CHECK OBJECT 'Z_ADRNR_WE' " Customized Authorization object -
ID 'DUMMY' FIELD '*'. " Adding by SU21
IF SY-SUBRC > 0.
MESSAGE E499(SY) WITH SY-UNAME 'No authorization!'.
ENDIF.
ENDIF.
ENDIF.