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
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow

ABAP Authority-Check Object For User Other Than Current

Using ABAP Authority-Check Object statement with For User addition enables ABAP developers to check authorization of a specific user in their custom programs. If the checked authorization object is defined for the related SAP user pointed with the help of "For User" addition. If FOR USER and a SAP user following the FOR USER addition is not defined in AUTHORITY-CHECK ABAP statement, authorization of the current user is checked by default.

ABAP developers can use the FOR USER addition to check authorization for a specific user instead of current user running ABAP program.

ABAP

Here is the ABAP code, following the FOR USER addition a local variable can be used to store the target SAP user name.

* Check authorization for user
AUTHORITY-CHECK OBJECT 'Z_TR_SALES'
FOR USER i_user_id
ID 'VKORG' FIELD lv_vkorg
ID 'VTWEG' FIELD lv_vtweg
ID 'SPART' FIELD lv_spart
ID 'ACTVT' FIELD '09'.
Code


SAP HANA and ABAP

Install SAP Free
CRM Companies List
Web Based CRM Software


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.