‎2009 Jan 08 9:28 AM
Hi,
I have to give authorization object for the specific plants..where they should only be able to eter the respectivebilling document numbers...
how to find out the authorization object?
‎2009 Jan 08 9:33 AM
‎2009 Jan 08 9:34 AM
‎2009 Jan 08 9:36 AM
HI
See t-code su21.
you can assign those authorization through SU24.
‎2009 Jan 08 9:36 AM
Hi,
SU21 is the tcode for authorization objects.
sample code
authority-check object 'V_VBAK_VKO'
id 'VKORG' field it_salesorg-vkorg
id 'VTWEG' dummy "FIELD '*'
id 'SPART' dummy "FIELD '*'
id 'ACTVT' dummy.
*If the user is not authorised
if sy-subrc 0.
*Give the error message.
endif.
regards,
Venkatesh
Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:51 PM
‎2009 Jan 08 10:39 AM
my requirement is...
in my screen..i have billing document field which will be entered by the users of different plants..
the users of the respective plant should be able to enter the billing document numbers generated by that plant only..other wise they sholud get an error message...how to do it?
i coded it like this..
assuming they have authorization for only their respective plants....is this correct way to do?
SELECT SINGLE WERKS FROM YYY_VBRK
INTO W_WERKS
WHERE VBELN = YYY_VBRK-VBELN.
AUTHORITY-CHECK OBJECT 'M_BCO_WERK'
ID 'WERKS' FIELD W_WERKS
ID 'ACTVT' FIELD '03'.
IF SY-SUBRC = 4.
MESSAGE E004(ZMICRO) WITH TEXT-001.
ELSEIF SY-SUBRC <> 0.
MESSAGE E004(ZMICRO) WITH TEXT-001.
ENDIF.
Edited by: Anil Kalive on Jan 8, 2009 4:09 PM
Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:51 PM
‎2009 Jan 08 10:45 AM
ok,
you can achive the same in below way:
1. first check if the user has authorization to the plant( hope plant is afiled on the selection screen or you have a plant with you by otgher means).
2. if user has authorization for that plant, get the document number from selection screen and check if the plant of that document number is the one which user belongs to,
3. if no flag a error message.
‎2009 Jan 08 11:40 AM