‎2006 Nov 07 4:59 PM
Hi all,
I HAVE A MODULE POOL PROGRAM AND I NEED TO PROVIDE AUTHORIZATION TO ACCESS THE THE Z TCODE FOR THAT MODULE POOL.
I have to write code checking sy-uname or is there any other way that can be used to provide access.
Thanks
swathi
‎2006 Nov 07 5:02 PM
Hi Swathi,
You have to write a code in your program or you can request your basis/security team to provide the access for the Z Tcode to whom ever required.
If you are writing the code, check this:
w_repid = sy-repid.
Authorization check
AUTHORITY-CHECK OBJECT 'Authobj name'
ID 'ACTVT' FIELD '16' " Execute
ID 'REPID' FIELD w_repid " Program Name
ID 'WERKS' DUMMY " Dummy
ID 'BUKRS' DUMMY. " Dummy
IF sy-subrc <> 0.
MESSAGE e278(rt).
ENDIF.
Shylesh
‎2006 Nov 07 5:07 PM
For new transaction you do not have to develop any checks in your program (if you want to check access rights for that transaction code only), just update your auth. profiles for object S_TCODE.
‎2006 Nov 07 5:08 PM
Hi Swathi,
you can use the following code:
AUTHORITY-CHECK OBJECT 'ZTCODE'
ID 'ACTVT' FIELD '16'
ID 'TCODE' FIELD <Transcation code for report/program>
Regards
Shiva
‎2006 Nov 07 5:17 PM
Hi ,
THANKS FOR YOUR REPLIES .
CAN ANYONE BE MORE CLEAR .
IF I HAVE USER XYZ THEN WHERE SHOULD I GIVE XYZ IN ORDER TO HAVE ACCESS FOR XYZ IN THE FOLLOWING CODE
AUTHORITY-CHECK OBJECT 'ZTCODE'
ID 'ACTVT' FIELD '16'
ID 'TCODE' FIELD <Transcation code for report/program>
THANKS
SWATHI
‎2006 Nov 07 5:22 PM
Swathi,
You can maintain profiles via for example PFCG, reports are available in SUIM. If it is a new transaction, you do not have to develop any checks in your program. System will check automatically access rights using object S_TCODE. Your user must have in its profile this object and your transaction code.
‎2006 Nov 07 5:42 PM
Hi Swati,
Basis/Security team (depends on your organisation) creates an object and assigns to the profile of the user 'XYZ' thru txn PFCG.
Just put similar piece of code in your module pool :
AUTHORITY-CHECK OBJECT 'ZOBJECT' "Object
ID 'TCODE' FIELD 'ZTCODE' "Your tcode
ID 'ACTVT' FIELD '16'. "Activity
IF SY-SUBRC NE 0.
MESSAGE E001 with 'User does not have
authorisation'.
ENDIF.
Cheers,
Vikram
Pls reward for helpful replies!!!