Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Authorization Object

Former Member
0 Likes
776

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?

7 REPLIES 7
Read only

Former Member
Read only

Former Member
0 Likes
738

HI

See t-code su21.

you can assign those authorization through SU24.

Read only

Former Member
0 Likes
738

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

Read only

0 Likes
738

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

Read only

Former Member
0 Likes
738

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.

Read only

Former Member
0 Likes
738

Hi

try this link out

regards

Prashant