2009 Sep 24 7:58 AM
hii,
i want to put restriction on user to view data of other plant in my z report.
for example
user of plant 100 can view details of plant 100 only
if he enter plant 200 in report ..error msg pop up..or no data found.
Thanks
2009 Sep 24 8:04 AM
You have to create an authorization object and use in your program
amd maintain authorization values in user profiles.
TABLES : PA0001,pa0034.
SELECT-OPTIONS: S_WERKS FOR PA0001-WERKS , "Personnel Area
S_BTRTL FOR PA0001-BTRTL , "Personnel Subarea
S_PERSG FOR PA0001-PERSG , "Employee Group
S_PERSK FOR PA0001-PERSK . "Employee Subgroup
SELECT-OPTIONS: S_FUNKT FOR PA0034-FUNKT.
AT SELECTION-SCREEN.
DATA: h_werks LIKE t500p OCCURS 0 WITH HEADER LINE ,
h_funkt LIKE t591a OCCURS 0 WITH HEADER LINE .
REFRESH :h_werks[] , h_funkt .
CLEAR :h_werks , h_funkt .
SELECT * FROM t500p INTO TABLE h_werks WHERE persa IN s_werks .
SELECT * FROM t591a INTO TABLE h_funkt WHERE infty = '0034' AND subty IN s_funkt.
LOOP AT h_werks .
LOOP AT h_funkt .
AUTHORITY-CHECK OBJECT 'Z_HR_AUTH'
ID 'PERSA' FIELD h_werks-persa
ID 'FUNKT' FIELD h_funkt-subty.
IF sy-subrc NE 0.
MESSAGE e001(zhrrep) WITH h_werks-persa h_funkt-subty .
ENDIF.
ENDLOOP.
ENDLOOP.
hii,
i want to put restriction on user to view data of other plant in my z report.
for example
user of plant 100 can view details of plant 100 only
if he enter plant 200 in report ..error msg pop up..or no data found.
Thanks
2009 Sep 24 8:01 AM
Create the authorization object and use them in ur program.
2009 Sep 24 8:04 AM
You have to create an authorization object and use in your program
amd maintain authorization values in user profiles.
TABLES : PA0001,pa0034.
SELECT-OPTIONS: S_WERKS FOR PA0001-WERKS , "Personnel Area
S_BTRTL FOR PA0001-BTRTL , "Personnel Subarea
S_PERSG FOR PA0001-PERSG , "Employee Group
S_PERSK FOR PA0001-PERSK . "Employee Subgroup
SELECT-OPTIONS: S_FUNKT FOR PA0034-FUNKT.
AT SELECTION-SCREEN.
DATA: h_werks LIKE t500p OCCURS 0 WITH HEADER LINE ,
h_funkt LIKE t591a OCCURS 0 WITH HEADER LINE .
REFRESH :h_werks[] , h_funkt .
CLEAR :h_werks , h_funkt .
SELECT * FROM t500p INTO TABLE h_werks WHERE persa IN s_werks .
SELECT * FROM t591a INTO TABLE h_funkt WHERE infty = '0034' AND subty IN s_funkt.
LOOP AT h_werks .
LOOP AT h_funkt .
AUTHORITY-CHECK OBJECT 'Z_HR_AUTH'
ID 'PERSA' FIELD h_werks-persa
ID 'FUNKT' FIELD h_funkt-subty.
IF sy-subrc NE 0.
MESSAGE e001(zhrrep) WITH h_werks-persa h_funkt-subty .
ENDIF.
ENDLOOP.
ENDLOOP.
2009 Sep 24 8:10 AM
HI,
After collecting all the desired data into final internal table.
use If condition and restrict use to view data.
e.g.
IF sy-uname = First user.
delete it_final where werks = '100'.
elseif sy-uname = Second_user.
delete it_final where werks = '200'.
endif.
Hope this will help you.
Regards,
Vijay
2009 Sep 24 8:12 AM
2009 Sep 24 8:22 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |