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 problem while reading HR infotype

waqas_rashid
Contributor
0 Likes
987

Hi ABAP Gurus,

I am facing a problem while reading infotype 0015 record using following:


PROVIDE * FROM p0015 BETWEEN pn-begda AND pn-endda.

.....

ENDPROVIDE.

I have also tried following:


  call function 'HR_READ_INFOTYPE_AUTHC_DISABLE'.
  call function 'HR_READ_SUBTYPE'
    exporting
      pernr                 = pernr-pernr
      infty                 = '0015'
      subty                 = '6100'
      begda                 = pn-begda
      endda                 = pn-endda
    tables
      infty_tab             = t_0015
   EXCEPTIONS
     INFTY_NOT_FOUND       = 1
     INVALID_INPUT         = 2
     OTHERS                = 3.

User don't have full access to infotype 0015. Out of 20 subtypes user is authorize to read only 2 sub types.

When user run this custom report, he is not able to see anything in preview. Although he can see the data from PA20.

Thanks for solution in advance.

Waqas Rashid

4 REPLIES 4
Read only

waqas_rashid
Contributor
0 Likes
766

Ok. I have identified the problem. But I don't know solution. Following is the culprit. When I remove following statement and read infotype using FM HR_READ_SUBTYPE then it works fine.


INFOTYPES: 0015 NAME p0015.

I don't want to use FM HR_READ_SUBTYPE because of following reasons:

1- Data retrieval is slow.

2- I will have to call this FM to read data from lot of different infotypes, which will increase code size.

3- I want to read only 2 sub types from infotype 0015. For this I will have to call FM HR_READ_SUBTYPE 2 times.

4- ....

5- ....

Waiting for a good solution.

Thanks,

Waqas Rashid

Read only

0 Likes
766

Hi,

Please try by giving 'BYPASS_BUFFER' importing parameter as 'X" in the FM 'HR_READ_SUBTYPE'.

Regards,

Soumya.

Read only

0 Likes
766

Hi,

Write a select statement on PA0015 and get the data for the particular pernr and for the subtypes.

clear : it_pa0015[] , it_pa0015.

Select pernr .... from PA0015 into table it_pa0015

where pernr = pernr-pernr and

subty in r_subty and " populate r_subty with the 2 values you need

endda ge pn-begda and

begda le pn-endda.

Regards,

Srini.

Read only

0 Likes
766

Hi,

You can also try the FM 'HR_READ_INFOTYPE'.

Regards,

Soumya.