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

Authority Check Problem

Former Member
0 Likes
405

Hi,

I am facing a strange problem in SAP HR.

I have made a Z program and it fetches data from table PA0001. Now the requirement is that if a user from one country is logged on then he/she can't see data of an employee from another country.

For e.g. a french employee can not see an Indian Employee's records.

I am using authority check P_ORGINCON and it is not working I have also tried Function Module HR_CHECK_AUTHORITY_PERNR that too did not work.

An employee from one country can still read data from PA0001 of employee of another country.

Can anyone please help me on this.

regards

Abhishek Sahi

1 REPLY 1
Read only

MarcinPciak
Active Contributor
0 Likes
325

Hi,

Do like this:


"get user county
user_molga = ...

"get molga for particular record from PA0001
select single MOLGA from T500P 
                     into     ee_molga
                     where PERSA = PA0001-WERKS.  "check EE's personal area here
if sy-subrc = 0.
   if user_molga = ee_molga. 
       "user is authorizated
   else.
       "user is not authorizated
   endif.
endif.

Regards

Marcin