Application Development 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: 

Authorization for the Field

Former Member
0 Kudos
68

Hi,

I have a requirement and is like this:

There is a sales order screen and we have created a Z field on the screen.This field is the Userid Field.

There are roles in which there are some user's.

What i want is that when ever the user is entering some userid then this userid needs to be checked against the roles which are already there.

If the user id is not in the roles then i have to display an error message.

Is there some Std Function module to achieve this & i know which roles i need to check for.

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos
38

Hi Sidharath,

You can get the role assigned to the user from table agr_users.

Please use below code to check role authority.

SELECT SINGLE agr_name INTO v_arg_name FROM agr_users

WHERE agr_name = c_role " role assigned to the user

AND uname = Userid Field.

Regards

Sikha

2 REPLIES 2

Former Member
0 Kudos
39

Hi Sidharath,

You can get the role assigned to the user from table agr_users.

Please use below code to check role authority.

SELECT SINGLE agr_name INTO v_arg_name FROM agr_users

WHERE agr_name = c_role " role assigned to the user

AND uname = Userid Field.

Regards

Sikha

Former Member
0 Kudos
38

AUTHORITY-CHECK OBJECT auth_obj [FOR USER user]

You define any user in the Field and the check works for that user only which is entered.

It works well.