‎2006 Sep 29 12:39 PM
Hello All,
I want to do an authorization check in such a way that only few assigned users can execute my ABAP report program. How should I go about it?
Puru
‎2006 Sep 29 12:45 PM
Hi
The ABAP code is
AUTHORITY-CHECK OBJECT <AUTH>
ID name1 FIELD f1
ID name2 FIELD f2
...
ID name10 FIELD f10.
IF SY-SUBRC <> 0.
MESSAGE E208(00) WITH 'user no auth...'.
ENDIF.
Now the porblem is if the object <AUTH> is std authorization or you have to create it.
If you've to create u've to use trx SU20 if u need to create z-field for authorization object and SU21 to create a new object.
After creating it you have to assign it to users profile
Max
‎2006 Sep 29 12:45 PM
‎2006 Sep 29 12:50 PM
Hi
THe ID is the field of authorization, for example in your case it should be the program name or trx code, the field is the variable where u store the value has to be checked by aut.:
AUTHORITY-CHECK OBJECT <Z_MY_AUTH>
ID PROGRAM FIELD SY-REPID .
IF SY-SUBRC <> 0.
MESSAGE E208(00) WITH 'user no auth...'.
ENDIF.
Max
‎2006 Sep 29 1:09 PM
‎2006 Sep 29 1:16 PM
Hi
- Trx SU21;
- Press Icon to create;
- Create a new class
- Select your class
- Press Icon to create
- Create your object: u can assign PROGRAM as field
Max
‎2006 Sep 29 1:05 PM
Hi,
you can authorize user to execute the program
in following ways
1) create a tcode for the report transaction
and use following code in program
at selection-screen output
authority-check object 'S_TCODE'
id 'TCD' field 'ZSPM'.
<b> where zspm is tcode</b>
if sy-subrc ne 0.
message s000 with 'You are NOT Authorized for
this Transaction'.
endif.
2) you can set authority group in program attributes
check with BASIS guys to set profile
3) you can restict the user at transaction level
in se93 by giving authorization object
check out sm01 transaction attributes in se93.
Regards
amole