Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Authorization object for Command Button

Former Member
0 Likes
2,436

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

3 REPLIES 3
Read only

Former Member
0 Likes
1,158

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 .

Read only

0 Likes
1,158

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.

Read only

Former Member
0 Likes
1,158

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.