10-08-2008 8:24 AM
Hello All,
I am Developing RFC which will fetch some data from SAP HR tables. (For Example: -PA2002)
My requirement is to restrict one user to access SAP HR table. (PA2002). i.e. when that user tries to execute RFC, he should not able to get data from that table.
Any help??
Thanks,
Prashant
10-08-2008 8:35 AM
Else,
since you are using customing RFC than you may write small piece of code
if SY-UNAME = '<user name>'.
proceed.
else.
exit.
endif.
insode RFC.
this would be useful in your case only as you are saying My requirement is to restrict one user to access SAP HR table.
10-08-2008 8:31 AM
using the Function HR_READ_INFOTYPE read the infotype, maintain the authorization . remove the authorization to read the infotype . then he will not be able to read it.
10-08-2008 8:46 AM
10-08-2008 8:49 AM
just go to the function module HR_READ_INFOTYPE and see the code. some authorization checks are happening inside. if you can remove the authorization for the user you want , he will not be able read the information from the infotype what ever you want.
so use the function HR_READ_INFOTYPE inside your rfc to read the data , instead of select.
10-08-2008 9:46 AM
Hi Vijay,
Many thanks for help.
Do you have any sample steps or lines of code to do the same?? Can we do the same using Authorization object??
Please Guide!!!
Thanks in Advance,
Prashant
10-08-2008 8:32 AM
Make a lock custom object in se11 with name EZ* for table pa2002 with lock mode = S, in your report, before you start reading data lock the record using FM ENQUQUE_<LOCK_OBJECT_NAME>, read data, after reading, unlock record using FM DEQUQUE_<LOCK_OBJECT_NAME> now while you were reading the data, no body else could read the same record from table pa2002
10-08-2008 8:35 AM
Else,
since you are using customing RFC than you may write small piece of code
if SY-UNAME = '<user name>'.
proceed.
else.
exit.
endif.
insode RFC.
this would be useful in your case only as you are saying My requirement is to restrict one user to access SAP HR table.