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

Plant Authorization

Former Member
0 Likes
1,752

Hi,

I was trying to restrict the user to get data for spefic plant . Is their a std approach to do this. I would like to have this restriction to custom programs/reports only.

Awaiting a reply

8 REPLIES 8
Read only

Former Member
0 Likes
1,355

Hi Guys,

Any replies pls...

Read only

Former Member
0 Likes
1,355

Hi,

Can You elaborate Your requirement.

Thanks,

sksingh

Read only

0 Likes
1,355

Hi,

It depends upon the kind of data you want to display and if you are using a standard transaction or not.

best regards

Roland

Read only

Former Member
0 Likes
1,355

Hi ,

I am not quite sure but user restrictions are basically done through authorisation role checks...usually we write function modules which allows access to users or restrict them.

for instance we create a program..a report or program and create a transaction code for it...we assign the transaction codes to roles: users,clerks,admin officers and superusers using Badis.

eg: we have transaction code t0001 for program ZTEST and you want him to give authorisation ...then u check

if tcode = t0001

and (criterion eg:sy-uname NE 'PRIYA')

message 'No Authorisation' type 'E'.

endif.

This is one method which i have seen widely being implemeted..Although the whole example was vague i hope it gave you some basic idea...

Regards

BX

Read only

Former Member
0 Likes
1,355

Hi Priya,

That purely depends on the Roles, You have restrict there itself. You can put the same condition in program also.

Regards,

Chandra.

Read only

Former Member
0 Likes
1,355

If you want to apply it only for custom programs/reports you must check first if and what authority-checks are implemented in the code (what objects, activities etc.). Once you get that information you can adjust your profiles.

Read only

Former Member
0 Likes
1,355

Hi,

Yes, it is possible with the authority check object. Here the basis/ function people will creat the Object and assigns the valid plants to it. we need to add the following code in the custome program to restict the execution to the specific plant.

  • Authority check for Plant

AUTHORITY-CHECK OBJECT 'Z_WERKS'(Authority check object)

ID 'ACTVT' FIELD '03'

ID 'WERKS' FIELD P_WERKS(Selection parameter)

IF sy-subrc NE 0.

MESSAGE e000 WITH

'No authorization to Division:'(054)

i_spart.

ENDIF.

Hope this will help you.

Regards,

Satya

Read only

Former Member
0 Likes
1,355

Hi ,

Create an authorization object for plant and assign allowed users to this object.

and use following code to restrict your user.

authority-check object 'ZPLANT'

id 'WERKS' field '__________'

id 'ACTIVITY' field '__________'.

if sy-subrc ne 0.

message' No authorization to access plant details'.

endif.

Regards,

Sudheer