Check Authorization Object using ABAP Function Module for SAP User
This tutorial shows how to check authorization object for SAP user using ABAP function modules. ABAP programmer can use function module AUTHORITY_CHECK to validate if an SAP user has the required authority object authorizations.
For example, I want to check if an SAP user has full administrative access to all features in SAP Screen Personas 3.0 Administration transaction /PERSONAS/ADMIN
If you launch SAP tcode SU21, Maintain the Authorization Objects transaction under PERS class P_ADMIN authorization object is used for "Personas Admin Authorization object"
Double click on authorization object P_ADMIN to display details.
Highlight the P_ACTVT_AD field in the Authorization fields table. Then click on Display Object Documentation button at the bottom of the screen.
As seen in above screenshot, authorization field P_ACTVT_AD value 01 identifies whether a user has full administration privileges on Personas Administration screen.
ABAP programmers can use AUTHORITY_CHECK function module in their SAP reports to test if a user has authorization object P_ADMIN with 01 admin activity permissions.
I hope above sample ABAP code block and short SU21 guide will help programmers to check whether user has an authorization object permission or not dynamically within ABAP code.