SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software Kodyaz SAP and ABAP Programming Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.




CRM Companies List
Web Based CRM Software


List SAP User-Roles Assignments in ABAP Code


To get a list of valid SAP User Role assignments in ABAP codes, developers can use AGR_USERS SAP transparent table to get a similar list seen on SU01D transaction screen.

Using SAP SU01D transaction code (Display Users screen), SAP users can display the Roles assigned to a specific SAP user or assigned roles to themselves.

SAP

SAP user roles assignments are stored in ABAP table AGR_USERS with the validity dates.

SAP

If you query the transparent table AGR_USERS in SE11 or using ABAP codes, you can get a list of SAP roles assigned to a user as follows

SAP user roles in AGR_USERS ABAP table

Here is a short ABAP code which queries SAP table AGR_USERS for valid user roles at the execution time for the current SAP user and lists SAP user roles on the screen.

SELECT * INTO TABLE @DATA(gt_user_roles) FROM agr_users
 WHERE uname = @syst-uname
 AND agr_name LIKE '%CUS%'
 AND from_dat <= @syst-datum
 AND to_dat >= @syst-datum.

LOOP AT gt_user_roles REFERENCE INTO DATA(lr_user_role).
 WRITE :/ lr_user_role->agr_name.
ENDLOOP.





SAP Tutorials

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table








Copyright © 2004 - 2017 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems