Skip to Content
0
Former Member
Dec 05, 2005 at 05:13 PM

Role/Auth Check in a Program

131 Views

All,

i have a Z prgm(dialog),have X users..Ecryone have access to T-code which runs this prgm..but when usr 1 runs he should have full access(edit/upload/download etc)..other user(no.2) only should be able to Edit some fields...i thought i can do this by Checking The Roles of Both Users..and using the following code..

i Looked at T-code Found Roles Associated with it..

Say 'YYYY'.

then looking for users who has that role..

SELECT * FROM AGR_USERS

  • INTO TABLE T_ROLES

  • WHERE UNAME = SYST-UNAME.

  • IF NOT T_ROLES[] IS INITIAL.

  • SORT T_ROLES.

  • READ TABLE T_ROLES WITH KEY AGR_NAME = C-YYYY IF SYST-SUBRC <> 0.

  • LOOP AT SCREEN.

  • IF SCREEN-NAME = 'XXXX'.

  • SCREEN-INPUT = '0'.

  • MODIFY SCREEN.

  • ENDIF.

  • ENDLOOP.

  • ENDIF.

  • ENDIF.

Problem with above code is...It explicitly looking for the role(say YYYY),But Most users have access to this T-code,Have a diffrent role?????I do not know how roles work..Is there a another way to do this??

thanks for any Input...

Regards..

Siva.