‎2006 Oct 24 11:48 AM
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
‎2006 Oct 24 12:19 PM
‎2006 Oct 24 12:49 PM
‎2006 Oct 24 12:53 PM
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
‎2006 Oct 24 1:00 PM
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
‎2006 Oct 24 1:04 PM
Hi Priya,
That purely depends on the Roles, You have restrict there itself. You can put the same condition in program also.
Regards,
Chandra.
‎2006 Oct 24 1:07 PM
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.
‎2006 Oct 24 1:08 PM
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
‎2006 Oct 24 1:11 PM
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