How to use authority check
2009-03-16 18:25
281 查看
How to set up Authorization Check
First step: creating authorization field
T-code: SU20
Second step: creating the authorization objects
T-Code: SU21
Third step: To check whether authorization objects exists in authorization field.
Fourth step: Adding the ‘Z_CARRNAME’ authorization object into the authorizations of role which belongs to corresponding user.
T-Code: PFCG
Here we use ‘ABAPUSER’ to create the authorization objects, so we add the ‘Z_CARRNAME’ authorization object into role which belong to ‘ABAPUSER’
Fifth step: creating the program ‘Z_AUTHORITY_CHECK’ to test.
*&---------------------------------------------------------------------*
*& Report Z_AUTHORITY_CHECK
*&
*&---------------------------------------------------------------------*
*& Author: James Zeng
*&
*&---------------------------------------------------------------------*
REPORT Z_AUTHORITY_CHECK.
CONSTANTS actvt_display TYPE activ_auth VALUE '03'.
DATA wa_SCARR TYPE SCARR.
PARAMETERS p_CARRn LIKE scarr-CARRNAME.
AUTHORITY-CHECK OBJECT 'Z_CARRNAME'
ID 'ACTVT' FIELD actvt_display
ID 'CARRNAME' FIELD p_CARRn.
IF sy-subrc EQ 0.
WRITE: 'authorization check successfully!'.
ELSE.
WRITE: 'authorization check unsuccessfully!'.
ENDIF.
(1) We use ‘DDIC’ user to test , the output is as below:
(2) We use ‘ABAPUSER’ to test, the output is as below screenshot.
First step: creating authorization field
T-code: SU20
Second step: creating the authorization objects
T-Code: SU21
Third step: To check whether authorization objects exists in authorization field.
Fourth step: Adding the ‘Z_CARRNAME’ authorization object into the authorizations of role which belongs to corresponding user.
T-Code: PFCG
Here we use ‘ABAPUSER’ to create the authorization objects, so we add the ‘Z_CARRNAME’ authorization object into role which belong to ‘ABAPUSER’
Fifth step: creating the program ‘Z_AUTHORITY_CHECK’ to test.
*&---------------------------------------------------------------------*
*& Report Z_AUTHORITY_CHECK
*&
*&---------------------------------------------------------------------*
*& Author: James Zeng
*&
*&---------------------------------------------------------------------*
REPORT Z_AUTHORITY_CHECK.
CONSTANTS actvt_display TYPE activ_auth VALUE '03'.
DATA wa_SCARR TYPE SCARR.
PARAMETERS p_CARRn LIKE scarr-CARRNAME.
AUTHORITY-CHECK OBJECT 'Z_CARRNAME'
ID 'ACTVT' FIELD actvt_display
ID 'CARRNAME' FIELD p_CARRn.
IF sy-subrc EQ 0.
WRITE: 'authorization check successfully!'.
ELSE.
WRITE: 'authorization check unsuccessfully!'.
ENDIF.
(1) We use ‘DDIC’ user to test , the output is as below:
(2) We use ‘ABAPUSER’ to test, the output is as below screenshot.
相关文章推荐
- Know How To Use Check Box Mapping Of Other Values Property In Oracle Forms
- How to use umdh to check Windows memory leak
- How to use NQ logs to check data in DB
- How To Check and Use Serial Ports Under Linux
- Spring Form Tags - How to use Text Box, Radio Button, Check Box and Drop Down List in Spring
- How to use Clamav check virus with sendmail
- How to Use Auto Layout in XCode 6 for iOS 7 and 8 Development
- How to use epoll? A complete example in C
- 如何在python中使用*args,**kwargs (How to use *args and **kwargs in Python)
- How you can use qemu/kvm base images to be more productive
- how to use javascript to open modal window?
- How to use JabRef (BibTeX) with Microsoft Word
- How to use iBatis/NHibernate in medium trust/partial trust environments like Mosso
- How to use the MQ?
- How To Use RPC Callback Functions
- How to Check Whether Oracle Binary/Instance is RAC Enabled and Relink Oracle Binary in RAC (文档 ID 28
- how to use 1checker_vim command
- How to use Ext4 如何使用EXT4
- Regular Expression in C# - How to make use of Expresso
- 如何使用代码美化器Uncrustify (How to use code beautifier Uncrustify)