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

Former Member
0 Likes
643

Hi Gurus,

My Functional Guy has created a roles in which he has specified plants.

example.

Role 1 -


> plants 1000 to 1300.

Role 2 -


> plants 1300 to 1500.

and so on.

requests the basis to assign Role1 to user A.

assign Role 2 to user B.

I have writen a Yreport which gives some details about the Plant.

When user A runs the report it must allow him run it only for Plant 1000 to 1300.

similarly when user B runs the same report it must alow him run only for the plant 1300 to 1500.

if User A trys to execute the report for other plants. it must through error message as not authorised to run for plant---.

tomorrow if the functional consultant wishes to provide authorisation for the user A to execute the report for plant 1000 to 1500. simply he will request the basis to assign the Role2 to user A.

Hope you can understand my situation.

my Requierment is to have a authority check against the Plant provided in the Role of the user.

Please Advise, its very urgent

Points Will be rewarded for all usefull replys

regards

Chandrra

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
629

Hi,

You can use the authorization object M_MATE_WRK for this purpose.


AUTHORITY-CHECK OBJECT 'M_MATE_WRK'
  ID 'ACTVT' FIELD '03'   "Display
  ID 'WERKS' FIELD l_plant.

IF sy-subrc NE 0.
  "Not authorised
ENDIF.

Check the help for syntax AUTHORITY-CHECK OBJECT for more detail. You can also double click at the M_MATE_WRK for more detail on the authorization object. Basically all authorization object is maintained through SU21.

Regards,

Teddy

2 REPLIES 2
Read only

Former Member
0 Likes
630

Hi,

You can use the authorization object M_MATE_WRK for this purpose.


AUTHORITY-CHECK OBJECT 'M_MATE_WRK'
  ID 'ACTVT' FIELD '03'   "Display
  ID 'WERKS' FIELD l_plant.

IF sy-subrc NE 0.
  "Not authorised
ENDIF.

Check the help for syntax AUTHORITY-CHECK OBJECT for more detail. You can also double click at the M_MATE_WRK for more detail on the authorization object. Basically all authorization object is maintained through SU21.

Regards,

Teddy

Read only

Former Member
0 Likes
629

Hi

Pass the plant to the authorizatio created and if you have multiple plants then pass all to authority check if they are not within the set then remove it from the list and update the same into the existing itab

Regards

Shiva