Hi friends,
In occupancy tab of REBDRO transaction, there is a field vacancy reason whose F4 help gives the multiple values.
Now, the requirement is to restrict the user to enter only a particular value.
To meet the above requirement, firstly I created an authorization object for the field Vacancy reason then in role i assigned the value '40' to the Vacancy reason field and '02' and '03' to the ACTVT field, then assigned the role to the user.
After that I created Enhancement implementation in which i wrote the code as-
AUTHORITY-CHECK OBJECT 'Z_VAC'
ID 'VACREASON' field '40'
ID 'ACTVT' FIELD '02' .
IF SY-SUBRC NE 0.
message 'You are not authorized to change the Vacancy Reason' type 'E'.
endif.
However, the SY-SUBRC remains zero for any value entered by the user i.e it does not restrict the user from entering value other than '40'.
Can somebody assist me regarding this, I will reward pts friends for the answers.
Thanks,
Rishi