‎2008 Feb 01 12:15 PM
Hi all,
How can I create the Authorization object for command button which is on application server.
if you do not have auth when you click on that command button, it should be say 'you dont have auth'.
please help me in this.
regards,
Ajay reddy
‎2008 Feb 01 12:23 PM
hi ajay
call FUNCTION 'AUTHORITY_CHECK_TCODE'
EXPORTING
tcode = v_tcode
EXCEPTIONS
ok = 1
not_ok = 2
OTHERS = 3.
Second way would while creation transaction there is something called a authorization gropu ,if you create that and basis guy attaches to role your problem is solved.
it's will help u
regards
kk .
‎2008 Feb 01 1:05 PM
In coorreponding function code in PAI, you can write the following code.
AUTHORITY-CHECK OBJECT '<objectname>'
ID 'ACTVT' FIELD '01'.
IF sy-subrc NE 0.
MESSAGE 'You are not authorized---' type 'E'.
ELSE.
perfom <action for that command>.
endif.
If the your authrization object does not assigned to the user profile ,it will shows the error message.
‎2008 Feb 01 1:24 PM
Hi,
Tcode for Authorization Objects are,
su20----> for defineing authorization field ,
su21-----> for authorization class,
su22------> for assignement authorization object
To create an authorization object:
1) Execute transaction SU21
2) Double-click an Object Class to select a class that should contain
your new auth object
3) Click on CREATE (F5)
4) (If creating custom field) - Click the 'Field Maintenance' button -->
Click on CREATE (Shift+F1)
5) Enter the Name for the New Authorization field and the corresponding
Data Element and SAVE
6) Confirm the Change Request data for the new Authorization Field
7) Go back two screens (F3-->F3)
😎 Enter the Authorization field name and document the object:
9) SAVE and ACTIVATE the documentation
10) Save the new Authorization Object
11) Confirm the change request data for the Authorization Object and
EXIT SU21
12) Finally, the SAP_ALL profile must be re-generated
Regards,
hema.