Skip to Content
avatar image
Former Member

Authorization-check P_PCR fails...

Hey Guys,

I have a little authorization problem...

I created a role with authorizationobject P_PCR.

 Payroll Area                   B8     
 Activity                       Change

In my program i have following code to check authorization :

GET pernr.
  AUTHORITY-CHECK OBJECT 'P_PCR'
    ID 'ABKRS' FIELD pernr-abkrs
    ID 'ACTVT' FIELD '02'.

  IF sy-subrc NE 0.
    REJECT.
  ENDIF.
  
* further processing..

Everytime i execute this code, sy-subrc eq 4... :(.

When i look into SU53 :

The authorization check failed
  Authorization obj. <i>P_PCR</i>  HR: Payroll Control Record
    Object Class <i>HR</i>  Human Resources
                                    B8
      Activity                      02

My user is added to the role, so i don't see anymore why i can't execute this report ... Does anyone has an idea for me ?

Thanks,

Kind Regards,

Tom

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Aug 22, 2007 at 08:03 AM

    Hi Tom,

    It seems that - under the GET PERNR, it is fetching multiple records, you have the change authority for Payroll Accounting Areas = B8.

    But during the execution of this block of code if the value of PERNR-ABKRS is anything other than B8, you will end up with sy-subrc 4.Just make sure that your program is designed to fetch the records related to Payroll Area B8 only.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Bon... Found the error...

        AUTHORITY-CHECK OBJECT 'P_PCR'
          ID 'ABKRS' FIELD pernr-abkrs
          ID 'ACTVT' FIELD '02'.
      
        IF sy-subrc NE 0.
          REJECT.
        ENDIF.

      In object P_PCR the field is not AB<b>KR</b>S, but the field is AB<b>RK</b>S.

      So, problem solved...

      Greetz,

      Tom