Contents Requirement ................................................................................................................................................. 2 Solution ......................................................................................................................................................... 2 Enable delete activity to the relevant authorization object ..................................................................... 2 Code the User Exit ..................................................................................................................................... 4 Create user roles with activity 06 ............................................................................................................. 5 Test scenario ............................................................................................................................................. 7
Requirement Requirement is to check user authorization at delivery document deletion. Eg: Only selected user ID’s should be able to delete delivery documents in the system. (Transaction VL02N)
Solution This functionality is not directly available in the standard SAP with authorization objects. Please refer OSS note: 580226. Therefore we have to go for below 2 step process. 1. Enable delete activity to the relevant authorization object 2. Code a user exit to check the activity status of the authorization object and to popup a error message
Enable delete activity to the relevant authorization object Tx: SU21 First you need to add activity “06” to authorization object V_LIKP_VST Activity “06” is the activity relevant for deletion
Go to the transaction
Click on Enter “V_LIKP_VST” under “Cell Content”
Press Enter key
Click on
button
Click on
in the next screen
Click on
button option
Mark “06”
Save
Click on
Now you have added the Delete option as an available activity to authorization object V_LIKP_VST.
Code the User Exit Tx: SE38
Eg:
Enter “MV50AFZ1” as program Click on Change button. You’ll have to get an object key and developer key for this as well Code below under the user exit: USEREXIT_DELETE_DOCUMENT.
Simple meaning of this code is; If activity status 06 is NOT marked in the authorization object - V_LIKP_VST of logged user; then gives an Abort type error message. My sample message is “No Authorization for this activity” TYPE 'A' is to give an abort type error message.
Create user roles with activity 06 Ask your basis consultant to mark activity ‘06’ in authorization object V_LIKP_VST; only for users who has privilege to delete the delivery document. For all users who should not have the deletion option, activity ‘06’ in authorization object V_LIKP_VST should be un-ticked. Tx: PFCG In this example, we have removed activity “06” from role ZSAP_ALL. Then all users who have ZSAP_ALL will not be able to delete deliveries.
Enter the relevant Role & go into EDIT mode
In “Authorizations” Section click on “Edit” button
Click on “Activity” & select the relevant activities you want to grant
Save & Re-Generate the roles
Test scenario For my user ID, activity “06” Is not marked. Which means I should not be able to delete the delivery. Get a saved delivery document. Eg: 80000027
Go to VL02N and go in to the delivery document
Press option in the delivery header Select “YES” for below message
It gives me below message
This is the Abort type Custom message, which I gave in the user exit.
Once I press it’ll abort the transaction Same will happen to Menu / Outbound Delivery / Delete as well
Note: This will not check the line item deletion in the delivery document.
Author: Anupa Wijesinghe E-Mail:
[email protected] /
[email protected] Website: www.learnsaptips.com View my profile in LinkedIn Follow me on Twitter
Disclaimer This article is done based on my research and readings, unless otherwise stated. The views expressed are my own and not of anyone else. Author accepts no liability for the content of the articles in this website or for the consequences of any actions taken on the basis of the information provided. Using this information is at the users own discretion and responsibility.