‎2007 Sep 03 1:37 PM
Hi,
I created a <b>authority object</b> which has 3 <b>object fields</b>, I want to confirm
whether the user has <b><u>anyone</u> of the 3 object fields</b>, is there a good way
to do it?
Please kindly advise.
Thanks and best regards.
‎2007 Sep 03 1:42 PM
Hi tt,
I think the easiest way to do so is to check individually each one of the three fields:
AUTHORITY-CHECK OBJECT ...
ID 'FIELD1' FIELD value1
ID 'FIELD2' DUMMY
ID 'FIELD3' DUMMY.
IF sy-subrc <> 0.
AUTHORITY-CHECK OBJECT ...
ID 'FIELD1' DUMMY
ID 'FIELD2' FIELD value2
ID 'FIELD3' DUMMY.
IF sy-subrc <> 0.
AUTHORITY-CHECK OBJECT ...
ID 'FIELD1' DUMMY
ID 'FIELD2' DUMMY
ID 'FIELD3' FIELD value3.
ENDIF.
ENDIF.
I hope this helps. Best regards,
Alvaro
‎2007 Sep 03 1:42 PM
Hi tt,
I think the easiest way to do so is to check individually each one of the three fields:
AUTHORITY-CHECK OBJECT ...
ID 'FIELD1' FIELD value1
ID 'FIELD2' DUMMY
ID 'FIELD3' DUMMY.
IF sy-subrc <> 0.
AUTHORITY-CHECK OBJECT ...
ID 'FIELD1' DUMMY
ID 'FIELD2' FIELD value2
ID 'FIELD3' DUMMY.
IF sy-subrc <> 0.
AUTHORITY-CHECK OBJECT ...
ID 'FIELD1' DUMMY
ID 'FIELD2' DUMMY
ID 'FIELD3' FIELD value3.
ENDIF.
ENDIF.
I hope this helps. Best regards,
Alvaro
‎2007 Sep 03 1:43 PM
Check the below PDF Document and here you will see good example code.
Thanks
Seshu
‎2007 Sep 03 1:44 PM
Hi,
you will need to use all the three field in the check..
1st will be the field that u r going to check.. for example a profit center
2nd will be the activity that u can perform 01, 02, 03
3rd will be the value for the above field.. for ex.. 10001
if i have PC 03 10001.. this means that i am authorized to view this profit center..
Thanks and Best Regards,
Vikas Bittera.
‎2007 Sep 03 1:46 PM
Hi..
Steps to implement authorization checks:
1. Creating Authorization object in SU21. (If it is not existing already)
Assign the Fields here
This is done by ABAP resouce.
2. Creating authorizations using these Auth Objects.
This is done by BASIS.
3. Assigning these authorizations to users (SU01)
This is done by BASIS.
4. Checking the Authorization of a user in a program
This is done by ABAP resouce
using the Statement called AUTHORITY-CHECK in a program.
This statement accepts the Values for the Fields and if a suitable authorization found in the User profile then it returns SY-SUBRC = 0.
<b>reward if Helpful</b>