Professional Documents
Culture Documents
To do this, the programmer should create authorization fields (ACTVT and CUSTTYPE)
and assign for each field defined the value to be checked (02, B). Authorization fields
are created under Tools → ABAP Workbench →Development → Other
tools → Authorization objects → Fields (transaction SU20).
Programmers should also create an authorization object (here S_TRVL_BKS) and assign
the authorization object to an object class.
You program the authorization check using the ABAP statement AUTHORITY-CHECK.
When this happens, the system checks the authorization profiles in the user’s master
record for the appropriate authorization object (S_TRVL_BKS). If the authorization is
found and it contains the correct values, the check is successful.
The system administrator has defined the following authorizations for the authorization
object S_TRVL_BKS:
User Miller has been assigned a profile containing both of these authorizations
(S_TRVL_CUS1 andS_TRVL_CUS2). Miller can therefore change bookings for
business customers.
User Meyers on the other hand, is only authorized to display the records
(S_TRVL_CUS1) and therefore cannot change bookings.
Authorization groups
The access protection system must ensure that only authorized individuals have access to the system and to
particular data. For achieving precise application security concerning authorization and to protect confidential
data against unauthorized access it is very important to focus on the use of authorization groups.
TBRG -- Contains all authorization groups and gives information about relation between authorization object and
authorization group. The description of the authorization groups is defined in table TBRGT.
The field name for authorization group -- BRGRU -- is used to make additional restrictions on authorizations /e.g.
for document maintenance/. In authorization objects and authorization checks, there are fields which are checked
to verify user authorizations. Customizing objects are combined in authorization groups, and the authorization
group is one of the two authorization fields, for example, in authorization object S_TABU_DIS which is in the
object class BC_A (Basis - Administration). This object is for displaying or maintaining tables. It controls access
using the standard table maintenance tool (transaction SM31), enhanced table maintenance (SM30) or the Data
Authorization object S_TABU_DIS has the following fields: DICBERCLS - Authorization group, maximum field
length is four characters; and ACTVT - Activity (02: Add, change or delete table entries, 03: Only display table
contents).
Generally, SAP standard tables are assigned to authorization groups. Theseassignments can be changed. You can
then assign tables manually to a suitable authorization group. To do this, start Transaction SM30 for maintenance
view V_DDAT, and create an entry for each of these tables. In V_DDAT is stored the assignment of Tables/Views
to Authorization Groups. V_DDAT is cross-client; therefore, it can be viewed and used in all clients.
Note: If you don't make a selection, all tables maintained in Customizing transactions are assigned to
authorization groups
From www.sapnet.ru:
Credentials in ABAP programs.
The system of separation of powers in the R / 3 system based on the use of office facilities, which constitute the definition of a structure consisting of
simple fields. Object-based reference for you create your own powers, which are collections of specific values for the fields of objects of reference.
Example. Object reference F_KNA1_GRP «debtors - the authority to account group" consists of two fields:
- KTOKD - Group Accounts
- ACTVT - Operation
For this object reference can be created by the authority
{Group = Accounts 0004 (branches); Operation = * (all operations)}
And this power is assigned to the user.
In ABAP programs verification of powers made by the operator
authority-check object <ObjectName>
id <imya_polya1> {field <value1> | dummy}
id <imya_polya2> {field <value2> | dummy}
....
In the statement lists all the object's field office and provides value for testing, or used the keyword dummy if the value of a particular field we are
currently not interested.
All the objects of reference are separated by grade, reflecting their functional purpose. View objects and their authority structures - the transaction SU21.
When should you use in your programs with authorization, it is best to use ready-reference objects, but objects are not always ready available and they
have to create.
For example, try to create an authority that will verify the user's authority to operate on a particular creditor (such a system does not).
Must first define the field, that will constitute the object. To do this, use transaction SU20. Our facility office will consist of two fields - the code of the
lender, and operation.
Initial screen of Transaction SU20:
To create your own objects using the Create button.
All created objects are called on Z. For the generated input field data element (often already existing and defining the essence of the field, in our case -
Lender), and a table to check the value (in our case, LFA1)
Save the box.
Second field - "Operation" - use the ready, it is already in the system:
Proceed to create an object reference. Transaction SU21.
"Fallthrough" in a class of objects, the relevant functional area corresponding to the created object
reference. In our case, this FI.
Create a new object using the Create button. Enter the name of the object and the first field.
Once we introduce a second field - ACTVT - you will see a new button - "Permissible operations." ACTVT field
office has a special meaning in the system, and after adding the object will need to enter a valid operation
for this object.
On the button "Available Operations" go to the management of values for field ACTVT. Pre prompted to save
the object.
In our case, mark the "Change" and "View", and keep a list of values.
Further, the exit of an object reference, because it has already been saved.
Feature of this transaction - we just do not see we created an object in the list. Needed to complete the transaction, then re-start it - the newly created
object will appear and you can view and modify if necessary.
After all this, the program is already possible to check on the powers created by the object:
In order to create your program in the future be included in the user role and bring up the powers should be as follows:
- Create a program based on your transaction, if it does not (Tr. SE93)
- Edit for the transaction list of the objects of reference as follows:
Start transaction SU24 (performed in the adjust mandante!). Enter the code of your transaction:
The following screen:
Need to select the desired transaction code and click on "Change ID verification"
For those transactions for which the appropriation of objects of reference have not yet taken place, will look like this:
Add your facility (click Paste). ID verification (green daw) set in the column of PP, as shown:
Save the data. Now for the object reference must be entered value is checked fields (if that makes sense). In our case, it would make sense if we develop
a transaction changes the lender and therefore for the field ACTVT in this transaction in any case be required to value '02 '.
Must be entered on the object reference and click on "Change the values of the fields."
A value changes by clicking on the icon "pencil".
Values of fields that are not known, for example ZLIFNR, leave blank.
Save the data. This setting is independent of mandanta, so within a single SAP system to carry anything anywhere is not necessary.
After this, when you turn on the transaction ZTEST01 a user role, in the corresponding profile of reference will be added to the power of ACTVT = '02 'and
undefined field ZLIFNR (its value is defined as, for example an interval or a value'*').
Authorization Objects are used to manipulate the current user's privileges for specific data selection and activities from within a program.
We could always create our own authorization objects and implement it in our own abap programs. As an example, we will create our own
authorization field similar to TCD used in S_TCODE Authorization object
Now we're done creating our own authorization object, let us now use and assign it to a user.
Now let's implement this authorization in our ABAP program. Let say we have a dialog program (ZCOMM) wherein we have a button on the
screen that when clicked, the user will go to the Create / Edit screen (1000) if he's authorized. On the other hand, he will go to display only
screen (2000) if he's not authorized. To do that, simply add the code below on your program.
Code:
AUTHORITY-CHECK OBJECT 'Z_TCODE' "authorization object that we've created
ID 'ACTVT' FIELD '01 '"Activity = 01, authorized to create
ID 'ZTCODE' FIELD 'ZCOMM'. "Tcodes that we wants to check for authorization
IF sy-subrc EQ 0.
CALL SCREEN 1000. "The user is authorized to create
ELSE.
CALL SCREEN 2000. "User is not authorized to create (Display only)
ENDIF.