2008 Jul 14 6:50 AM
Hi Guru's,
I am creating one authority object(YXC_OM) in a T-code , the authority should be users from sales org 'GR01' is only able to use the T-Code also i have to restrict the Activity to
Create, Change and Display, Execute, Maintain, Confirm, Save, Delete, update , Enter, cancel
Currently i am using the following code. But it is giving me a dump, can somebody tell me what wrong thing i am doing?
I have never worked with authority object before.
AUTHORITY-CHECK OBJECT 'YXC_OM'
ID 'VKORG' FIELD 'GR01'
ID 'ACTVT' FIELD '01'
ID 'ACTVT' FIELD '02'
ID 'ACTVT' FIELD '03'
ID 'ACTVT' FIELD '06'
ID 'ACTVT' FIELD '16'
ID 'ACTVT' FIELD '21'
ID 'ACTVT' FIELD '31'
ID 'ACTVT' FIELD '32'
ID 'ACTVT' FIELD '76'
ID 'ACTVT' FIELD 'G7'.
Regards,
Khan
2008 Jul 14 7:35 AM
At a time activity field can take only one value But u have specified multiple one at the same time thats why it is giving dump.
It should be like this:
AUTHORITY-CHECK OBJECT 'YXC_OM'
ID 'VKORG' FIELD 'GR01'
ID 'ACTVT' FIELD '01'.
if Create, Change and Display, Execute, Maintain, Confirm, Save, Delete, update , Enter, cancel means all the access for the activity then u can put '*' for ACTVT. Like:
AUTHORITY-CHECK OBJECT 'YXC_OM'
ID 'VKORG' FIELD 'GR01'
ID 'ACTVT' FIELD '*'.
Otherwise u have to check one by one..like
AUTHORITY-CHECK OBJECT 'YXC_OM'
ID 'VKORG' FIELD 'GR01'
ID 'ACTVT' FIELD '01'.
if sy-subrc = 0.
endif.
AUTHORITY-CHECK OBJECT 'YXC_OM'
ID 'VKORG' FIELD 'GR01'
ID 'ACTVT' FIELD '02'.
if sy-subrc = 0.
endif.
................
................
................
AUTHORITY-CHECK OBJECT 'YXC_OM'
ID 'VKORG' FIELD 'GR01'
ID 'ACTVT' FIELD 'G7'.
if sy-subrc = 0.
endif.
Regards,
Joy.
Hi Guru's,
I am creating one authority object(YXC_OM) in a T-code , the authority should be users from sales org 'GR01' is only able to use the T-Code also i have to restrict the Activity to
Create, Change and Display, Execute, Maintain, Confirm, Save, Delete, update , Enter, cancel
Currently i am using the following code. But it is giving me a dump, can somebody tell me what wrong thing i am doing?
I have never worked with authority object before.
AUTHORITY-CHECK OBJECT 'YXC_OM'
ID 'VKORG' FIELD 'GR01'
ID 'ACTVT' FIELD '01'
ID 'ACTVT' FIELD '02'
ID 'ACTVT' FIELD '03'
ID 'ACTVT' FIELD '06'
ID 'ACTVT' FIELD '16'
ID 'ACTVT' FIELD '21'
ID 'ACTVT' FIELD '31'
ID 'ACTVT' FIELD '32'
ID 'ACTVT' FIELD '76'
ID 'ACTVT' FIELD 'G7'.
Regards,
Khan
2008 Jul 14 7:35 AM
At a time activity field can take only one value But u have specified multiple one at the same time thats why it is giving dump.
It should be like this:
AUTHORITY-CHECK OBJECT 'YXC_OM'
ID 'VKORG' FIELD 'GR01'
ID 'ACTVT' FIELD '01'.
if Create, Change and Display, Execute, Maintain, Confirm, Save, Delete, update , Enter, cancel means all the access for the activity then u can put '*' for ACTVT. Like:
AUTHORITY-CHECK OBJECT 'YXC_OM'
ID 'VKORG' FIELD 'GR01'
ID 'ACTVT' FIELD '*'.
Otherwise u have to check one by one..like
AUTHORITY-CHECK OBJECT 'YXC_OM'
ID 'VKORG' FIELD 'GR01'
ID 'ACTVT' FIELD '01'.
if sy-subrc = 0.
endif.
AUTHORITY-CHECK OBJECT 'YXC_OM'
ID 'VKORG' FIELD 'GR01'
ID 'ACTVT' FIELD '02'.
if sy-subrc = 0.
endif.
................
................
................
AUTHORITY-CHECK OBJECT 'YXC_OM'
ID 'VKORG' FIELD 'GR01'
ID 'ACTVT' FIELD 'G7'.
if sy-subrc = 0.
endif.
Regards,
Joy.
2008 Jul 14 8:29 AM
Hi ,
It already helped me a bit, but can you guys tell me, if i pass any variable instead of the value will it work or not?
AUTHORITY-CHECK OBJECT 'XP_OM'
ID 'VKORG' FIELD LV_VKORG
ID 'ACTVT' FIELD '06'.
IF SY-SUBRC NE 0.
perform AUTHORITY_ERROR_MSG.
ENDIF.
In the above code, i have one variable LV_VKORG which is having the value GR01, so will this code work or not.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |