User Authority Check...

User Authority Check
---
About Authorty Common T-Code:

SU01:Assign profile=>就是创建用户然后分配权限的profile
SU02:Creating profile=>创建profile
SU03:Creating authorization=>创建权限
PFCG:Role Maintain=>角色的维护
SU21:List of object class=>在这里创建object class
SU22:List of transaction with check object=>把事务代码相关的check object找出来
SU24:Maintain assignment of authorization object of transaction=>根据事务代码找到相关的authority object.
SU25:我没有权限使用,就是复制系统标准的profile
SUIM:Display a generated authorization profile
SU53:Display authorization data for user=>列出用户的权限
SM59:Display and Maintain RFC Destinations => 远程登录

---
Authority Check Type List:
    (1). Transcation Run Check.
   Create T-Code, you can in [Authorization Object] Field there Input Authority Object and Set Value Field.If User

want run the corresponding T-Code, User must have the corresponding authority,else user run the T-Code ,system will show

message.
    (2). Program Run Check.
   In the ABAP Program Attributes,Input Authorization Groups Attribute, Authorization Group and S_Develop and

S_Program Authorization Object 's P_Group Field Correlation.Via Check the Field and User Master Record's Corresponding value

to decide user whether run this program.
    (3). Inside Program Authorization Check.
   If System Can not automatic control user run the program's Authorization, You may also use inside program check

authorization.
 Check Like this:
 Authority-Check Object 'Object_Name'
   ID   'Field_Name1'     Field  F1
   ID   'Field_Name2'     Field     F2

 If you not want check some field,you can set:
   ID   'Field_Name'      Dummy


Step 1: Use T-Code:SU21 Crate a Atuhority Object Class
     e.g:  ZZW01

Step 2: Use T-Code: PFCG  Or SU02->TO Profile Generator.
       
  Authorizations -> Change Authorization Data ->Manually(At Menu Bar) ->Authorization Object ->ZZW01

Step 3: Codeing.

---Complete Program: ZZW_AUTHORITY_CHECK

*-----------------------------------------------------------------------
*
*  Company ASAT Company Limited
*
*  ProgrameName:  ZZW_AUTHORITY_CHECK
*
*  Author: Wei_Zhu
*
*  Date: 06/01/2007
*
*  Description: Study SAP In Programe How To Check Control User
*               Authority.
*
*-----------------------------------------------------------------------
REPORT  ZZW_AUTHORITY_CHECK                     .
  Parameters: P_Carrid  Type Sflight-Carrid.

  Authority-Check  Object 'ZZW01'
           ID 'CARRID' Field P_CARRID
           ID 'ACTVT'  Field '999'.

if SY-SUBRC = 4.
  Message e045(sabapdocu) with p_carrid.
elseif sy-subrc <> 0.
*  message e045(sabapdocu) with 'Error!'.
  message e045(sabapdocu) with sy-subrc.
endif.

 

posted on 2007-06-04 17:01  封起De日子  阅读(128)  评论(0编辑  收藏  举报

导航