I am currently using a number of custom fields our infosets. Some of them are used for ad-hoc queries, and some are used for other things.
The code of the fields generally looks like this (this field name is called ZUSRID_USERID):
clear zusrid_userid.
select usrid from pa0105 into zusrid_userid
where pernr = p0105-pernr
and usrty = '0001'
and endda >= pn-endps
and begda <= pn-begps.
endselect.
With this code i am looking into the PA table corresponding to an infotype - in this case to grab the userid for the user.
While it generally works alright, it poses two problems for me.
The first is that a user that runs a query using this field needs to be authorized to access table PA0105.
The second problem is that i fear that this way of collecting data is very resource consuming. It is clear for me that when listing 10,000+ employees there is a huge difference when including and excluding these custom fields.
Does anyone have a suggestion on how to get the data from the infotype instead of the table?