2007 Aug 28 1:57 PM
Hi Gurus.
Please tell me that if i use an authority check for an object
which is not maintained in the user's profile by the basis guy.what will be the value of sy-subrc
and will the user be able to see the data or not.
2007 Aug 28 1:59 PM
Hi,
Much of the data in an R/3 system has to be protected so that unauthorized users cannot access it. Therefore the appropriate authorization is required before a user can carry out certain actions in the system. When you log on to the R/3 system, the system checks in the user master record to see which transactions you are authorized to use. An authorization check is implemented for every sensitive transaction.
If you wish to protect a transaction that you have programmed yourself, then you must implement an authorization check.
This means you have to allocate an authorization object in the definition of the transaction.
For example:
program an AUTHORITY-CHECK.
AUTHORITY-CHECK OBJECT <authorization object>
ID <authority field 1> FIELD <field value 1>.
ID <authority field 2> FIELD <field value 2>.
...
ID <authority-field n> FIELD <field value n>.
The OBJECT parameter specifies the authorization object.
The ID parameter specifies an authorization field (in the authorization object).
The FIELD parameter specifies a value for the authorization field.
The authorization object and its fields have to be suitable for the transaction. In most cases you will be able to use the existing authorization objects to protect your data. But new developments may require that you define new authorization objects and fields.
<b>Example:</b>
authority-check object 'S_TCODE'
id 'TCD'
field 'SM35'.
if sy-subrc ne 0.
" * User does not have authority for transaction SM35!!!
endif.Regards
Sudheer
2007 Aug 28 1:59 PM
Hi,
Much of the data in an R/3 system has to be protected so that unauthorized users cannot access it. Therefore the appropriate authorization is required before a user can carry out certain actions in the system. When you log on to the R/3 system, the system checks in the user master record to see which transactions you are authorized to use. An authorization check is implemented for every sensitive transaction.
If you wish to protect a transaction that you have programmed yourself, then you must implement an authorization check.
This means you have to allocate an authorization object in the definition of the transaction.
For example:
program an AUTHORITY-CHECK.
AUTHORITY-CHECK OBJECT <authorization object>
ID <authority field 1> FIELD <field value 1>.
ID <authority field 2> FIELD <field value 2>.
...
ID <authority-field n> FIELD <field value n>.
The OBJECT parameter specifies the authorization object.
The ID parameter specifies an authorization field (in the authorization object).
The FIELD parameter specifies a value for the authorization field.
The authorization object and its fields have to be suitable for the transaction. In most cases you will be able to use the existing authorization objects to protect your data. But new developments may require that you define new authorization objects and fields.
<b>Example:</b>
authority-check object 'S_TCODE'
id 'TCD'
field 'SM35'.
if sy-subrc ne 0.
" * User does not have authority for transaction SM35!!!
endif.Regards
Sudheer
2007 Aug 28 2:04 PM
HI
thanks 4 d reply.
but u didnt get my ques..
I am asking that is it necessary that all the data of r3 is protected.
for ex. let it be the case that the user tries to view some fields of a table but for that table authorisation object is not maintained by the basis guy in the iser's profile.
so will the user be able to display the data or not?
2007 Aug 28 2:02 PM
Hi Gaurav,
When an authority check fails, the value of sy-subrc is 4. After the authority check you will need to check the sy-subrc value and give an error message that we normally do..
But regarding the user will be able to do futher processing or not, it depends on your coding.. if you have given an error message following authority check fail, then the user will not be able to do anything.. and if you have not given this, then there is no use of authority check here..
Please see further info in this thread:
Thanks and Best Regards,
Vikas Bittera.
**Points for useful answers**
2007 Aug 28 2:07 PM
Hi,
u'll get sy-subrc value 12(if the object is not created).
it it is created and not assigned to ur user id u will get sy-subrc = 0 always.
<b>reward if helpful</b>
rgds,
bharat.
2007 Aug 28 2:11 PM
Hi,
The main use of Authority Check is to give authorization to the specific users. If Authority check is not given any user can use the program or table.
Ex:- I also created the authorization for the program nothing problem i have faced.below i am giving the example which i have created.
AUTHORITY-CHECK OBJECT 'Z_SDPS01'
ID 'SD_PS1'
FIELD '02'.
IF sy-subrc NE 0.
MESSAGE e000 (38) WITH text-002.
ENDIF.
Reward points!!
Thanks & Regards,
Vasudeva Rao
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |