‎2008 Nov 27 6:34 AM
Dear Friends,
I have taken Material Type in selection screen.Requirement is multiple user(login id) can aceess particular material Type.Lets take one example,
user1 can see data of only FERT,
user2 can see data of all material type
user3 can see data of FERT & HAWA.
So i have to restriction in material type.I have written code for that matter but probem is not solved
DATA: NO TYPE N.
RANGES: R_MTART FOR T134-MTART.
SELECT-OPTIONS: S_MTART FOR T134-MTART.
DESCRIBE TABLE S_MTART LINES NO.
IF NO EQ 000.
SELECT * FROM T134.
AUTHORITY-CHECK OBJECT 'M_MATE_MAR'
id 'MTART' field T134-MTART.
IF SY-SUBRC = 0.
R_MTART-SIGN = 'I'.
R_MTART-OPTION = 'EQ'.
R_MTART-LOW = T134-MTART.
APPEND R_MTART.
ENDIF.
ENDSELECT.
ELSE.
SELECT * FROM T134 WHERE MTART IN S_MTART.
AUTHORITY-CHECK OBJECT 'M_MATE_MAR'
id 'MTART' field T134-MTART.
IF SY-SUBRC = 0.
R_MTART-SIGN = 'I'.
R_MTART-OPTION = 'EQ'.
R_MTART-LOW = T134-MTART.
APPEND R_MTART.
ENDIF.
ENDSELECT.
ENDIF.
CLEAR: NO.
DESCRIBE TABLE R_MTART LINES NO.
IF NO EQ 000.
message e000(ZFI) WITH TEXT-000 .
ENDIF.
-
So please look into matter and reply me.
Thanks.
‎2008 Nov 27 6:38 AM
hi,
after you use AUTHORITY-CHECK OBJECT statement in program
tell the basis people to maintain this object in profiles of the users with
respective material types thay are authorised.
‎2008 Nov 27 6:41 AM
hi,
i think you didn't specify anything regarding 'ACTVT' in authority -check
Sample code:-
here it is checked whether user has display authority or not....
LOOP AT t_t001_temp INTO wa_t001_temp.
AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'
ID 'BUKRS' FIELD wa_t001_temp-bukrs
ID 'ACTVT' FIELD '03'.
IF sy-subrc NE 0.
MESSAGE e063(yl) WITH wa_t001_temp-bukrs.
ENDIF.
CLEAR wa_t001_temp.
ENDLOOP.
‎2008 Nov 27 6:44 AM
Thans for reply.
But Basis person have already done restriction in user login profile.
although problem is not solved
Thanks.
‎2008 Nov 27 6:51 AM
hi,
where did you define that statement in program.
declare in at selection screen on field event.
‎2008 Nov 27 6:59 AM
Hi Shivam,
I have verified the object 'M_MATE_MAR' in SU21. It doesn't have the fieldname MTART defined in the object. I guess you are using the wrong object to check the authorisation. In this object you can just check using the Field - BEGRU (Authorization Group) not MTART.
Please check in the transaction - SU21 what all fields have been defined in the object.
Ask your functional person or basis people for the correct authorization object to be used.
‎2008 Nov 27 8:10 AM
‎2008 Nov 27 8:18 AM
‎2010 Dec 29 7:08 AM