07-01-2016 10:46 AM
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.
07-01-2016 11:04 AM
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.