I need to modify the behaviour of VA42 (Contract Change) as follows:
If field VBAK-MAHDT is not initial and doc types are Z020-Z022, do not allow any changes to any fields except to field VBAK-MAHDT.
If that field is initial, VA42 should work as normal.
I've tried making this coding change in form userexit_field_modification in MV45AFZZ. However it does not perform as desired.
if sy-tcode = 'VA42'.
if ( ( vbak-auart = 'Z020' )
or ( vbak-auart = 'Z021' )
or ( vbak-auart = 'Z022' ) ).
if vbak-mahdt is initial.
else.
message W899 with 'Change not allowed'.
endif.
endif.
endif.
Any suggestions are welcome.
Thanks.