Application Development 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: 

Using LDB PNPCE without using statement GET PERAS

former_member208197
Participant
0 Kudos

Dear Experts,

we are in process of developing a HR report using LDB PNPCE.

Will all the authorizations work if even do not use event GET PERAS.

Generally GET PERAS check for the authorization at infotype level , so if we don't use GET PERAS and still need a authorization check how do we proceed.

Thanks,

Kartheek.

1 REPLY 1

pranay570708
Active Contributor
0 Kudos

Hi,

Try using the function module to check authorization  to update the particular infotype.

 

  See the sample code below.

 

* does the user have authority for infotype 8 of the pernr?

CALL FUNCTION 'HR_CHECK_AUTHORITY_INFTY'

     EXPORTING

          tclas            = 'A'

          pernr            =  rp50g-pernr

          infty            = '0008'

          subty            = '0000'

          begda            = sy-datum

          endda            = sy-datum

          level            = 'W'

*    TABLES

*         I0001            =

     EXCEPTIONS

          no_authorization = 1

          internal_error   = 2

          OTHERS           = 3

          .

  IF sy-subrc <> 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

  ENDIF.