07-26-2010 2:01 PM
Hi
As I have understood the difference between FM HR_READ_INFOTYPE and a select directly from PA0001 (as example) is that the FM take the authorization into account. (please correct me if I am wrong).
My problem is that I need to select from the infotype for a lot of pernr, so I would use this statement:
SELECT * FROM pa0001 INTO CORRESPONDING FIELDS OF TABLE wt_pa0001
FOR ALL ENTRIES IN wt_pernr
WHERE pernr = wt_pernr-pernr
AND begda LE pn-endda
AND endda GE pn-begda.
but then I don't get the authorization check.
For the FM HR_READ_INFOTYPE I can't use the "FOR ALL ENTRIES".
Can I do it in an easy way, or do need to do the select, and then use an authority check after the select from each infotype?
07-26-2010 3:51 PM
You can use AUTHORITY-CHECK OBJECT command, in case you use select statement.
07-26-2010 2:35 PM
Hi Invlmn,
I am new to SAP.
I did a testing project, in which,
Whenever user passed User ID and / or Division,
I was getting asset details, head quarter IDs L1 IDs, etc from PA0040, PA0001, PA0105 etc.
So I know how i did get the records from those files,
Do you think i can help you?
Thanks and regards,
Sachin Bhatt.
07-26-2010 3:51 PM
You can use AUTHORITY-CHECK OBJECT command, in case you use select statement.
07-26-2010 4:35 PM
Calling HR_READ_INFOTYPE or selecting directly from the tables may depend on how much data you are processing. If you only need to retrieve a few records, you could process the PERNR records you need in a loop and call HR_READ_INFOTYPE for each. If you're processing a larger number of records, check the authorization for the each table first and then do a SELECT for all entries. Before you read, make sure that your "FOR ALL ENTRIES" table is not empty. In order to make your code more generic, you may want to use function module HR_CHECK_AUTHORITY_INFTY to check the authorization for each infotype. This is the FM that the HR_READ_INFOTYPE function module uses.
.. Craig
07-26-2010 8:15 PM
I have a lot of data to select, so I need to use the select for all entries.
Then I would like to use the FM HR_CHECK_AUTHORITY_INFTY as you suggest. But for using this, I need to call it for each PERNR, and I would like to avoid that. Is that possible?
07-26-2010 9:19 PM
It appears that HR_CHECK_AUTHORITY_INFTY requires the PERNR to be specified in the input parameters.